GM 3
GM 3
Version 1.0
Page 1 Of 92
Controlled copy Omniscripting Induction Manual
Change Log
Date Author Comments Approved By
22- Cognizant Draft Version
March- Omni QA
2012
Page 2 Of 92
Controlled copy Omniscripting Induction Manual
Table of Contents
Page 3 Of 92
Controlled copy Omniscripting Induction Manual
Omniscript is a scripting language that is essentially used to perform the following functions for
the Retirement Services record keeping system viz Omniplus.
Creation of custom reports & extraction of data at a record level, thereby easing the effort
involved in data mining.
Update data at a record level, thereby easing the effort involved in data setup.
Creating transactions using the various Omniscript functions, thereby easing the effort
involved in transaction creation.
Processing of custom edits & validation at a plan and participant level, thereby adhering
to the various business rules.
Generation of formatted XML or HTML web pages.
Prior to Omniscript, Omnicalculator (Omnicalc) was used to perform the afore mentioned
functions. Here’s the relationship between Omniscript & Omnicalc,
Omniscript vs Omnicalc
Think of it this way: OmniPlus now processes two scripting languages, the old language, which
was referred to as “Calculator”, and the new language, Omniscript. (NOTE: In the System
documentation, the entire scripting package, old code and new code, is referred to as
Omniscript). These two languages may be used concurrently within the same text file BUT are
independent of each other in terms of record access. This means that the parameters or records
being examined by one language do not have any effect on the parameters or records being
examined by the other. However, either language may be used at any time in a Text File.
This section attempts to provide some insight into the question on everyone’s mind: When do I
use the old code (Calculator) versus the new code (Omniscript)? You will probably find a range of
different answers depending on who you ask. Probably the best answer is that in time, as you
develop your knowledge of Omniscript, you’ll be able to answer that question yourself.
Page 4 Of 92
Controlled copy Omniscripting Induction Manual
However, there are at least 2 instances where it is probably better to use Calculator over
Omniscript. These are listed below:
1. If you are generating a report which possibly may produce more than 1000 lines PER
PARTICIPANT, you should use Calculator because Report Writer Integration has a limit
of 1000 lines per participant. In this instance, the term “PER PARTICIPANT” means the
pointer that is controlled by the system (or T966), not the one controlled by Omniscript.
Page 5 Of 92
Controlled copy Omniscripting Induction Manual
PARM Section
TEXT Section
CALC Section
PARM Section
Parameter section is one of the Report Writer function that is included in an Omniscript especially
if written directly in Omnistation, to specify the reporting feature of the output. Following are the
Parm functions,
Page 6 Of 92
Controlled copy Omniscripting Induction Manual
DE # FIELD NAME Values Description
OR220 OR_PRINT_SECOND Contains Xerox commands that print after
OR_PRINT_FIRST, but before detail statements.
OR230 OR_PRINT_LAST Contains Xerox commands that print after all detail
statements.
Text Section
Text section is used for formatting the resulting values. The user can control the output
parameters & the manner in which the output needs to be displayed in the Text Section. The
various functions of the Text Section are as follows,
Page 7 Of 92
Controlled copy Omniscripting Induction Manual
DE # FIELD NAME Values Description
off.
OR_HEADER will be produced at the top of each new page.
CALC Section
Calc section is where all the Omniscript functions, statements, loops are specified. Omniscript
executable statements are specified in the Calc section.
Following are the functions available in the Calc section,
Page 8 Of 92
Controlled copy Omniscripting Induction Manual
DE # FIELD NAME Values Description
page breaking facility.
OR_PAGE_INIT Prepare to output a page. Clear page and set sort key.
OR_PAGE_WRITE Output the current page. Should be proceeded by a
OR_PAGE_INIT and one or more OR_RPT-GENs.
OR001 OR_AREA_1_ON Use OR_AREA_1 in the Text Section to define a text
OR_AREA_1_OFF block. If it is defined as a conditional text block,
OR_AREA_1_ON and OR_AREA_1_OFF can be used
in the Calc Section to explicitly turn the text block on
and off.
OR002 OR_AREA_2_ON Use OR_AREA_2 in the Text Section to define a text
OR_AREA_2_OFF block. If it is defined as a conditional text block,
OR_AREA_2_ON and OR_AREA_2_OFF can be used
in the Calc Section to explicitly turn the text block on
and off.
OR003 OR_AREA_3_ON Use OR_AREA_3 in the Text Section to define a text
OR_AREA_3_OFF block. If it is defined as a conditional text block,
OR_AREA_3_ON and OR_AREA_3_OFF can be used
in the Calc Section to explicitly turn the text block on
and off.
OR004 OR_AREA_4_ON Use OR_AREA_4 in the Text Section to define a text
OR_AREA_4_OFF block. If it is defined as a conditional text block,
OR_AREA_4_ON and OR_AREA_4_OFF can be used
in the Calc Section to explicitly turn the text block on
and off.
OR005 OR_AREA_5_ON Use OR_AREA_5 in the Text Section to define a text
OR_AREA_5_OFF block. If it is defined as a conditional text block,
OR_AREA_5_ON and OR_AREA_5_OFF can be used
in the Calc Section to explicitly turn the text block on
and off.
OR_HEADER_ON turns the area in the Text Section on.
OR_HEADER_OFF turns the area in the Text Section off.
Page 9 Of 92
Controlled copy Omniscripting Induction Manual
DE # FIELD NAME Values Description
OR_AREA_ALL_ON When multiple areas in the Text Section have been
OR_AREA_ALL_OFF defined, you can use OR_AREA_ALL_ON and
OR_AREA_ALL_OFF in the Calc Section to explicitly
turn all the areas on and off.
Omniscript Statements are not case sensitive. A combination of Upper & Lower case can be used
in an Omniscript. Every Omniscript Statement should end with a semi colon (;)
Comments
Omniscript comments are an integral part of Omniscript programming. Comments help to
understand the purpose of various program statements. It’s a good practice to include comments
Page 10 Of 92
Controlled copy Omniscripting Induction Manual
in every Omniscript, to ease the understandability of the script. Following are the two types of
Comments used typically in an Omniscript,
Informational Comments - > This type of Comment helps understand the purpose of an
Omniscript Statement. This type of Comment starts with /* and ends with */.
Non-Executable Statement Comments -> This type of Comment is used to prevent a
particular Statement from being executed. This type of Statement has a * sign in the
beginning of a Statement. Any Statement preceding the * sign w--ill be ignored during
Omniscript processing / execution.
Variables
Omniscript variables are similar to variables used in any other conventional programming
language used essentially for storing values. Following are the various Variables available in
Omniscript,
FD – Function-Defined fields
IT – Indexed Text fields
IW – Indexed Work fields
KV – Key Value fields
SD – System-Defined fields
TX – Text fields
WA – Work Accumulator fields
WF – Work Fund fields
WK – Work Products fields
Text Fields(TX)
Text fields can hold alphanumeric values. TX001 through TX120 are available for usage. Values
stored in Text fields are limited to 200 characters. Here’s an example for Text Fields,
TX001 = PTPHOBJ_DE(289); /* Stores the value of Address Line 1 in TX001 * /
There are various operations that can be performed using Text variables, which will be addressed
in the Omniscript Utility Function (in the subsequent chapter(s)).
Page 11 Of 92
Controlled copy Omniscripting Induction Manual
Work Fields(WK)
Work Fields are used to house / accommodate numeric values. Following are some of the
characteristics of Work fields
WK001 = PTPFOBJ_NumDE(120) ; /* Read Net Dollars and assign the value to a Work
Variable */
Work Fields can have particular uses in transactions that use OmniScript for custom exit
processing. For example, WK212 - WK217 are predefined for the T966 transaction, and
therefore cannot be user-defined for that transaction.
Page 12 Of 92
Controlled copy Omniscripting Induction Manual
KV002=SD003;
KV7=301;
WK1=PA200@***;
INITKV;
/*INITKV resets all “KV” values to zero. “KV” values can now be re-defined for new record
access and retrieval */
In the above example KV1 is being used to assign the low trade date, and KV2 is being used
to assign the high trade date. SD003 is another special variable which stores the current
trade date of the system. KV7 us being assigned the transaction code. When this code runs,
it will assign the sum of all the PA200 (Gross contribution) posted from T301 transaction
(KV7) starting from 01/01/1999 (KV1) to current trade date (KV2/SD3).
Following is the list of key KVs,
Page 13 Of 92
Controlled copy Omniscripting Induction Manual
Literal equivalent values (Aliases) may be substituted for SD data element identifiers.
Available SD aliases are listed in the Literal Equivalents column of the table in
Appendix –B at the end of this chapter.
Some common uses for SDs include, Date Conversion Facility, OmniScript Text
Substring Facility
Page 14 Of 92
Controlled copy Omniscripting Induction Manual
any number of times between a range of 500 to 999,999,999 you can assign the value to
SD080 before initiating the loop. Below example illustrates the same.
SD080=1000;
PTPHOBJ_NEXT();
LOOP WHILE PTPHOBJ_VIEW();
WK1=PTPHOBJ_DE(021);
IF (WK1<20);
TX1=’ACTIVE’;
ENDIF;
IF (WK1>19);
TX1=’TERM’;
ENDIF;
OR_RPT_GEN;
ENDLOOP;
The above piece of code will traverse through 1000 participant records, and based upon the
employment status it will print on the report if the participant is ACTIVE or TERM.
Page 15 Of 92
Controlled copy Omniscripting Induction Manual
environment variables. This field is in
HHMMSS format
Page 16 Of 92
Controlled copy Omniscripting Induction Manual
0 – Report only changed field values
1 – Report regardless of whether field
value is changed
2 – Report only unchanged field values
3 – Do not report any field values
Page 17 Of 92
Controlled copy Omniscripting Induction Manual
Withdrawal transaction (T444).
SD023 TranType1 Transaction Type - 1st character. First System X01
character of SD022.
SD024 TranType2 Transaction Type - 2nd character. System X01
Second character of SD022.
SD025 Transaction Code. Currently executing System X03
transaction.
SD030 SDWKIDX Index Work Field - Base Value. User N03
SD031 SDTXIDX Index Text Field - Base Value. User N03
SD033 SDFund Default Fund-ID. The current Fund-ID User X03
applicable to a fund level variable fetch
or store in which no ‘@’ parameter is
specified. See the ‘Fund Usage’ section.
SD035 SDPrDate Price Date. Can be set to Override the User N08
date used for Price fetches. This field is
in CCYYMMDD format.
SD036 SDLPart Last Participant Flag. Indicates last System X01
participant in master file processed.
Values are:
N – No. Last participant not processed.
Y – Yes. Last participant processed.
SD037 SDAllow0Pr Allow Zero Price Flag. Allows market 'N' value must be set by X01
value calculation (PA999) without a price user.
on file.
Values are:
Y – Yes. (Default)
N – No. A price is required to calculate
market value (PA999).
SD039 Transaction Date. The date on the System N08
Currently executing Transaction, in
CCYYMMDD format.
Page 18 Of 92
Controlled copy Omniscripting Induction Manual
converting date formats. This field will
infer a century designation and return an
eight-digit date in CCYYMMDD format.
SD041 SDDays Date Conversion Field-2. Used for System or user. N05
converting date formats. This field will
return the number of days since
01/01/1900.
SD042 SDWeekday Date Conversion Field-3 (Day of the System N02
Week format). Used for converting date
formats. Values are:
1 – Monday 5 – Friday
2 – Tuesday 6 – Saturday
3 – Wednesday 7 – Sunday
4 – Thursday
SD043 SDMMDDYY Date Conversion Field-4. Used for System or user. N06
converting date formats. This field will
return a six-digit date in MMDDYY
format.
SD044 SDJullian Date Conversion Field-5. Used for System or user. N07
converting date formats. This field will
return a seven-digit Julian date in
CCYYDDD format.
SD045 Date Conversion Field-6. Used for System or user. N08
converting date formats. This field will
return an eight-digit date in MMDDCCYY
format.
SD046 Business Calendar Date Input. This field User N08
is set by the user to determine if a
specified date is a business date. This
date is input in CCYYMMDD format. This
field is in CCYYMMDD format.
SD047 Business Calendar Date Output. If System defined based on N08
SD046 is valued, this field contains the the value of SD046.
corresponding business date according
to the Business Calendar textfile in
CCYYMMDD format. If SD046 is a
holiday, this field will contain the
Page 19 Of 92
Controlled copy Omniscripting Induction Manual
previous or following business date.
This field is in CCYYMMDD format.
SD050 OmniScript Return Code System X04
SD051 SDEnvir OmniScript Return Code System X08
Environment Operating System (OS)
MVS
PC
UNIX
SD052 SDReleaseID Plus Release Identifier including ptf System X12
level (e.g., ‘5.20.20', '5.30.01', 'DEV2’)
SD053 SDRelDate Plus Release Date System k
SD054 SDOrigPgm Originating Program (e.g., "OCRUN", System X12
"BAUPDT", "BAREPT")
SD055 SDEditMode Edit Mode System X01
P – Post
E – Edit
T – Trade Advance
X – Edit Error
R – Trade Error
SD056 SDProcMethod Process Method System X01
B – Batch
O – Online (CICS)
1 – OmniStation/Workstation
C – Conversion
Page 20 Of 92
Controlled copy Omniscripting Induction Manual
up to 40-character alphanumeric value
that can be retrieved by providing start
character and length. Works with
SD061 below.
SD061 Text String 1 - Number Work Area. The User N15D06
first of two fields (SD066 is the other)
provided to convert numeric OmniScript
values to text values. A numeric value
entered in this field is converted to a text
value and placed in the first 15 bytes of
SD060. The '@' parameter is used to
designate the format of the value placed
in SD060. It is expressed as
SD061@00#. Values for the '@'
parameter used to define format are:
@001 - ZZZ,ZZZ,ZZ9.99
@002 - ZZZ,ZZZ,ZZ9.999999
@003 - ZZZ,ZZZ,ZZ9.999
@004 - ZZZ,ZZZ,ZZ9.9999
@005 - ZZZ,ZZZ,ZZ9
@006 – 99B99B99
SD065 Text String 2 - Text Work Area. Stores User X200
up to 40-character alpha-numeric value
that can be retrieved by providing start
character and length. Works with
SD066 below.
SD066 Text String 2 - Number Work Area. The User N15D06
second of two fields (SD061 is the other)
provided to convert numeric OmniScript
values to text values. A numeric value
entered in this field is converted to a text
value and placed in the first 15 bytes of
SD065. See definition of SD061 above
for values and correct formatting in
OmniScript text.
SD068 Text String - Start Character Position. User N02
Numeric position of the starting
Page 21 Of 92
Controlled copy Omniscripting Induction Manual
character within the text string. This
field referenced if the first two bytes of
the ‘@’ parameter are ‘00’.
SD069 Text String - Length. Number of User N02
characters to be referenced from the text
string. This field referenced if the third
byte of the ‘@’ parameter is ‘0’.
SD070 Voucher Number System N09
SD071 Folder Name. Folder name of the file System X22
submitted for processing.
SD072 User ID. User ID from either the System X06
transaction being processed or the
current online user .
SD075 EACH Mode Flag. Controls records User X01
processed by the EACH@ command.
Values are:
0 or P – Accesses PF records
1 or F – Accesses FC records
I – Accesses IC records
S – Accesses SC records
Page 22 Of 92
Controlled copy Omniscripting Induction Manual
N – Events are ignored or no events
have been added.
SD091 is set to “Y” when events are
added and may be set to “N” to disable
event processing.
SD095 Validate DE Flag. Forces an OmniScript User X1
compile to reject if an Object Access
Function (XXYYOBJ) requests an invalid
data element number.
Legal Values:
"Y" - Produce a compile error if an
invalid data element is requested.
SD100 OmniScript Function Numeric Return System N07
Code.
A numeric value that may be returned by
an OmniScript function call. Legal
values vary by function and operation.
SD101 OmniScript Function Text Return System X40
Message.
A text value that may be returned by a
OmniScript function.
SD102 OmniScript Function Trace flag. User X01
“N” or blank – Do not produce trace
messages (default)
“Y” – Produce trace messages
For more information, see OmniScript
Trace Facilities.
SD104 Base Event Abend Flag. User X01
Set to ‘Y’ in Base Event script to cause
the system to abend.
SD105 OmniScript Return Code Level. This System X01
field can be set when an OmniScript
calls an external program (i.e., user exit)
or a variable ROUTINE (i.e., PERFORM
tx1).
0 – OK 3 – Error
1 – Info 4 – Severe
Page 23 Of 92
Controlled copy Omniscripting Induction Manual
2 – Warning 5 – Fatal
Page 24 Of 92
Controlled copy Omniscripting Induction Manual
allocated during a process. It does not
return the amount of memory that is
currently allocated.
SD123 Currently allocated segments (SD120- System N13
SD121). This field tracks the number
memory gets and subtracts out the
number of memory frees.
SD125 Trace Statements Seconds - Set to a User N07D06
number of seconds. Any Script
instruction which takes longer will be
shown on SYSOUT. Set to .01 to
request that all statements traced and 0
to have no statements traced.
SD126 Trace Limits - Provides a maximum User N09
number of lines for which the SD125
DISPLAY will be done. Limits output to
a manageable size.
SD127 Trace Statements - Number of User N09
instructions to trace the execution of via
Sysout messages.
Page 25 Of 92
Controlled copy Omniscripting Induction Manual
processing any more participants.
SD201 Current Transaction Code (VTD060) System X03
SD202 Current Folder Name (VTD050) System X30
SD203 Current Transaction Participant ID System X17
(VTD070)
Note: This data element is not always
the same as SD002, since the SD203
may be 000000000 for plan level
transactions
SD204 Current Transaction Sequence Number System N07
(VTD090)
SD205 Current Transaction Plan Num (VTD005) System X06
SD206 Current Transaction Date, in System N08
YYYYMMDD format
SD207 Current Transaction Document ID System X15
(VTD400)
SD208 Current Transaction Usage Codes System X10
(VTD580)
SD220 Current Transaction Error Message Id. If System X07
a transaction error occurred, SD220 will
contain the most recent error message
ID for the transaction. Refer also to the
OmniScript function RPMsgs, which
allows full access to Current Transaction
Error Messages.
SD221 Current Transaction Error Parms. If a System X40
transaction error occurred, SD221 may
contain any parameters used with the
error message found in SD220.
Note: SD221 is limited to the first 14
characters of parameter data.
Refer also to the OmniScript function
RPMsgs, which allows full access to the
parameters for Current Transaction Error
Messages.
SD222 Current Transaction Number of Errors. If System N05
Page 26 Of 92
Controlled copy Omniscripting Induction Manual
a transaction error occurs, SD222 will
contain the number of error messages
issued for the transaction.
Refer also to the OmniScript function
RPMsgs, which allows full access to the
parameters for Current Transaction Error
Messages.
SD230 Skip This Participant. Can be set to 'Y' User X01
at the PartStart or PartTranStart events.
Skips all transaction processing for the
current participant.Skip This Participant.
Can be set to 'Y' at the PartStart or
PartTranStart events. Skips all
transaction processing for the current
participant.
SD231 Skip This Transaction. Can be set to 'Y' User X01
at the TranStart event. Skips processing
this transaction.
Work accumulator fields (WA) accumulate results that are not to be reinitialized to zero
between each participant processing. All WA fields are user-defined. Values must be loaded
to work fields (WK) to be printed. Up to 100 WA fields are available for use (WA001 through
Page 27 Of 92
Controlled copy Omniscripting Induction Manual
WA100). The example below demonstrates how WA fields might be used to increment check
numbers and print them sequentially. An explanation of the function of each Omniscript
statement follows.
Work accumulator (WA) field are not available with all transactions or Omniscript Processing
Exits. In general, WA fields are used only with the Custom Full Page Report Generator
(T966) transaction to accumulate values across participants.
Indexed work fields (IW) are used to store temporary values and assign them to work fields (WK).
IWs reduce the number of repetitive statements required because they can be repeatedly used in
a single OmniScript, but have their values assigned to incrementing work fields. This gives IWs
the unique advantage of being especially useful with repeating OmniScript statements such as
the LOOP and EACH@ commands.
Indexed work fields (IWs) are assigned to corresponding work fields (WK) based on the setting of
the Indexed Work Field Base Value (SD030). This field is established in the OmniScript text and
drives the incrementing of the IW/WK link in the OmniScript text. Normally, IW000 assigns a
value to WK000. If SD030 contains a value, IW000 assigns a value to WK000 increased by the
value in SD030. Thus, if:
SD030=100, then
IW000 will assign a value to WK100,
IW001 will assign a value to WK101,
IW002 will assign a value to WK102
When the end of a repeating Omniscript command is reached (EACH@ or LOOP), SD030 is
reset to the amount to increment IW/WK link. Thus, if the above example were complete after
WK102, then:
Page 28 Of 92
Controlled copy Omniscripting Induction Manual
SD030=+3, then
IW000 will assign a value to WK103 (on the next pass through the EACH@ or LOOP)
IW001 will assign a value to WK104,
IW002 will assign a value to WK105
Then the EACH@ or LOOP continues and the sequence is repeated again beginning with
WK106, WK107, etc. The example below demonstrates how a LOOP command could be used
with indexed work fields to increment values that could be used for a statement or report on loan
balances. An explanation of the function of each Omniscript statement follows.
Example:-
Create a report for each participant to display the Market Value, Share Balance, Contributions,
and Dividends for Funds 1, 2, 3, 4, and 5. The Report Writer recognizes >100, >101, >102, etc.,
as work fields (WK100, WK101, etc.).
Page 29 Of 92
Controlled copy Omniscripting Induction Manual
IF (WK001 > 4);
ENDEXIT;
WK001=+1;
SD030=+3;
ENDEACH;
Result
Base Work Field Value (SD030) is initialized to a value of '100'. The first time the 'EACH'
Statement is executed, IW000 through IW003 are converted to WK100 through WK103
respectively. Before exiting the 'EACH' Statement, SD030 is incremented by a value of '4' to
change the value of SD030 to '104' prior to the next execution of the 'EACH' Statement.
The second time that the 'EACH' Statement is executed, IW000 through IW003 are converted to
WK104 through WK107 respectively. Again, SD030 is incremented by a value of '4' prior to the
next execution of the 'EACH' Statement.
Because WK100 through WK119 are the only work fields required to generate the values for the
report, a special counter is stored in WK001 to monitor the number of times that the 'EACH'
Statement has been executed. The WK001 counter is initialized to '1', and is incremented by '1'
prior to the next execution of the 'EACH' Statement. An 'IF' Statement is included within the
'EACH' Statement to check if WK001>5, and if so, execution of the 'EACH' Statement is ended.
Work Fund Fields (WF) allow fund-related intermediate calculated results to be held.
Work Fund fields are particularly helpful in the Report Writer facility, where a great many figures
or balances are to be printed on one page. For instance, if you need to print Market Value, Share
Balance, Contributions, and Dividends for all investments in a Plan, a WF field can be assigned to
each fund in the CALC SECTION of the Report Definition. The TEXT SECTION can be set up
with the appropriate Fund-ID for each calculated Work Fund Field.
WFs can be followed by an '@' symbol and a three character specific Fund ID. The Fund
ID can be 'source' generic (i.e., 10*), 'investment' generic (i.e., **A), or all generic (i.e.,
***).
Page 30 Of 92
Controlled copy Omniscripting Induction Manual
If a WF is not followed by an ‘@’ Fund ID qualifier, the FUND-ID usage rules are
followed: the CURRENT-FUND-ID (SD033) is used.
WFs are only valid for selected applications.
OmniScript contains up to 999 work fund fields (WF001 through WF999). Note that the
number of available Work Fund Fields may be limited based on independent variables
unique to each Plan.
WFs can be user defined or predefined by the transaction you are processing. Most
transactions set aside a block of WFs to perform certain tasks. Before creating a
program, you must be familiar with the pre-defined WFs for the transaction. Note: Each
documentation manual contains a list of all pre-defined fields.
WFs reduce the number of repetitive statements required, making the program easier to
read.
The FUNDS= XXX Command is used to reserve available storage within the Report
Writer when using WFs. Please refer to the Report Writer - Parms section of this manual.
Examples:- The example below demonstrates how WF fields might be used to store participant
amounts. An explanation of the function of each OmniScript statement follows.
Page 31 Of 92
Controlled copy Omniscripting Induction Manual
ENDEACH;
IF PH980<59.06;
EACH@**A;
WF004=0;
WF005=0;
WF006=0;
ENDEACH;
END;
Indexed text fields (IT) are used to store temporary values and assign them to text work fields
(TX). ITs reduce the number of repetitive statements required because they can be repeatedly
used in a single OmniScript, but have their values assigned to incrementing text work fields.
These fields work much the same way as Indexed Work fields (IW).
Indexed text fields (ITs) are assigned to corresponding text work fields (TX) based on the setting
of the Indexed Text Field Base Value (SD031). This field is established in the OmniScript text
and drives the incrementing of the IT/TX link in the OmniScript text. Normally, IT000 assigns a
value to TX000. If SD031 contains a value, IT000 assigns a value to TX000 increased by the
value in SD031.
Example
In the following example, four IT fields are used with the EACH command; therefore, SD031 must
be increased by a value of '4' before each subsequent execution of the loop.
Page 32 Of 92
Controlled copy Omniscripting Induction Manual
(FD) Function Data Elements : Function Data Elements are used to perform temporary loan
calculations. Function Data Elements allow users to pass information to OmniPlus and allow
OmniPlus to perform calculations, such as amortization and date calculations.
Possible Applications:
Perform loan calculations for reporting or inquiry purposes (i.e., determine the payment
amount for a specified loan amount and number of payments)
Produce loan amortization schedules in a custom format, either before or after a loan has
been issued.
Produce a loan application or document
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
Arithmetic Operators
Page 33 Of 92
Controlled copy Omniscripting Induction Manual
Append TX001 + =: Assign and WK001=WK002=:WK003;
(Alphanumeric TX002; propagate a
Values) value into
multiple fields
Assignment Operators
OmniScript assignment statements store values in data fields. Values may be simple (from
another element or literal) or intermediate (computed from an expression). When an assignment
is made from a text (alphanumeric) field to a numeric field, the OmniScript facility scans the text
field and converts it to a numeric value.
Assignment operators store values in data fields.
The table below lists the assignment operators recognized by the OmniScript facility.
The operator ‘=:’ is used to store a value in the left parameter, while also giving the value as a
result. ‘=:’ can be used to store a value and also provide the value for further processing.
Examples
Page 34 Of 92
Controlled copy Omniscripting Induction Manual
WK001=WK002=:100; Stores 100 in WK001 and WK002;
Note: The first variable must be followed by an equal (‘=’) all other variables must have an equal
colon (‘=:’).
Comparison Operators
Comparison operators produce a true or false result when comparing two operands. The table
below lists the comparison operators recognized by the OmniScript facility and provides a simple
example.
Page 35 Of 92
Controlled copy Omniscripting Induction Manual
…
Logical Operators
Logical operators compare two or more operands and generate a true or false result. A FALSE
value is returned for a zero result, and a TRUE value is returned for a non-zero result. The table
below lists the logical operators recognized by the OmniScript facility and provides a simple
example.
Page 36 Of 92
Controlled copy Omniscripting Induction Manual
Following are some of the control statements used to control the flow of program,
Conditional Statements
IF / ELSE / END
The 'IF / ELSE / END' statements test a condition and execute statements based on the results of
the test. An 'IF/END' statement tests a condition and may have up to four hundred intermediate
work fields held within the one IF statement. Intermediate work fields hold the result of logical
operations such as found in IF statements in OCSEM. If the condition is TRUE, OmniScript
statements dictate the action to be taken before an “END” statement occurs. If the condition is
FALSE, the OmniScript ignores the OmniScript statements for that participant, unless there is an
ELSE statement. In this case, the OmniScript statements following the ELSE will be executed up
until the END statement. For every “IF” statement, there must be an accompanying 'END' or
'ENDEXIT' statement. ENDIF may also be used in place of an END. See examples below.
Page 37 Of 92
Controlled copy Omniscripting Induction Manual
Simple 'IF/END'
Simple 'IF/ENDIF'
The next example adds the 'ELSE' option to the conditional statement. 'ELSE' introduces
OmniScript statements that dictate action to be taken if the condition is FALSE.
Simple 'IF/ELSE/END'
END; ignore the participant, but sets the value of PH600 to '2'
(ELSE statement). The 'END' statement is necessary to
Page 38 Of 92
Controlled copy Omniscripting Induction Manual
stop the 'IF' conditional query.
The third example adds a "nested" 'IF' statement, that is, a condition that must be met after an
initial condition has been tested. Remember that each 'IF' statement must have a corresponding
'END' or 'ENDEXIT' statement.
The next example illustrates a sequential 'IF' statement. In this example, multiple conditions are
tested in sequence with OmniScript directions following each conditional test.
Sequential 'IF/END'
Page 39 Of 92
Controlled copy Omniscripting Induction Manual
'IF' conditional queries.
The final example illustrates a complex nested 'IF' statement. In this example, a condition is
tested and directions dictated before another condition is tested and further directions dictated.
ELSEIF
The ELSEIF; statement can be used in combination with an IF statement to allow checking a list
of exclusive conditions, then ending with a single END statement. Use of the simple ELSE;IF
combination requires an END statement for each IF statement.
IF (WK1=1);
TX1=’a’;
ELSEIF (WK1=2);
TX1=’b’;
ELSEIF (WK1=3);
TX1=’c’;
ELSEIF (WK1=4);
TX1=’d’;
END;
Following is the same example without using ELSEIF, in which an END is required for each IF
Page 40 Of 92
Controlled copy Omniscripting Induction Manual
statement.
IF (WK1=1);
TX1=’a’;
ELSE;
IF (WK1=2);
TX1=’b’;
ELSE;
IF (WK1=3);
TX1=’c’;
ELSE;
IF (WK1=4);
TX1=’d’;
END;
END;
END;
END;
Iteration Statements
EACH@ / ENDEACH
The 'EACH@' statement identifies a FundId for processing that may be generic or specific for
both fund or source (10A, 10*, **A, or ***) in the format 'EACH@10A', or 'EACH@***', etc. Every
'EACH@' statement must have an accompanying 'ENDEACH' statement. Any number of
commands may be entered between the 'EACH@' initial statement and the 'ENDEACH' closing
statement. An 'IF/ENDEXIT' statement may be used to exit the 'EACH' loop prematurely.
See the FUND ID USAGE section for the use of SD033, ‘?’, and ‘*’ for specifying and selecting
fund ids.
· The EACH statement sets the current fund Id (SD033) in turn to the key value of each specified
record.
Page 41 Of 92
Controlled copy Omniscripting Induction Manual
· SD033 is restored to its prior value after the ENDEACH.
IT000=FC026; Sets the fund ID number (FC026) and the fund name
(FC031) in indexed text fields (which correspond to
IT001=FC031;
TX001 and TX002 for printing).
Page 42 Of 92
Controlled copy Omniscripting Induction Manual
TX003, and IT001 stores the FC record information in
TX004, and so on with each pass. This way, TX records
are not overwritten with each pass. The 'ENDEACH' is
necessary to stop the 'EACH@' loop if less than 10 fund
control records are found (and the 'ENDEXIT' is never
executed).
EACH_IC@***;
...
ENDEACH;
EACH_SC@***;
...
ENDEACH;
Rather than using the @ fund identifier, a fund id can be given in a variable.
TX1=’**A’;
EACH_FC(TX1);
….
ENDEACH;
An EACH statement without an @ fund identifier or suffix, will reference the value stored in the
current fund Id (SD033). If no value is stored in SD033, no records will be returned.
SD033=’10*’;
EACH;
...
ENDEACH;
Note: The SD075 flag still overrides the EACH _PF default.
Page 43 Of 92
Controlled copy Omniscripting Induction Manual
LOOP / ENDEXIT / ENDLOOP
The 'ENDLOOP' command redirects the process flow back to the first statement of the block to
start the loop processing on the next participant. In the example below the OmniScript uses a
'LOOP/ENDLOOP' sequence to store loan balances in work fields for reporting. The loop looks
for loan numbers up to '3' and records the loan number and the loan balance in indexed work
fields.
Simple 'LOOP/ENDLOOP'
KL001=WK001; Sets the loan number field to '1' (because WK001 was
pre-set to this value). This ensures that each pass of the
OmniScript for a participant starts with Loan 1.
Page 44 Of 92
Controlled copy Omniscripting Induction Manual
IW000=LH300; Sets IW000 to the loan number.
Example
Task
Sum WK fields 1 through 50 into WK100 using Indexed Work (IW) fields.
LOOP;
WK100 =+ IW1;
IF (SD30>=50);
ENDEXIT;
ENDLOOP;
Result
LOOP WHILE/UNTIL
A WHILE or UNTIL condition can be used with the loop, and is preferred over the IF/ENDEXIT
processing.
WK1=0;
...
Page 45 Of 92
Controlled copy Omniscripting Induction Manual
WK1=+1;
ENDLOOP;
WK1=0;
...
WK1=+1;
ENDLOOP;
Termination Statements
QUIT
Normally, OmniScripts execute until the end of the supplied statements at the bottom of the text.
The 'QUIT' command is used with an 'IF' statement to exit the OmniScript immediately when a
condition is met. This command differs from 'GOBACK' in that 'QUIT' always exits the OmniScript
function completely, while 'GOBACK' only exits the current routine. In the example below the
OmniScript is designed to exit if the participant status is terminated (31). Otherwise, work fields
are used to store contribution, cash, and share balances.
Simple 'QUIT'
WK002=PF120@10*;
WK003=PF130@10*;
Note: The QUIT statement does not necessarily stop output from printing. When using a T966
consider setting the Report Selection Indicator (WK212) equal to “1” before using the QUIT
statement.
ABEND
A second termination command is the 'ABEND' statement. This statement terminates the current
job step for all plans processing, and on some platforms (e.g. MVS) generates a system dump for
Page 46 Of 92
Controlled copy Omniscripting Induction Manual
diagnostic purposes. 'ABEND' is typically reserved for debugging and locating serious problems.
The command generates a message that states that the abnormal ending of the OmniScript was
requested by the OmniScript text based on a conditional statement.
CAUTION: This keyword should only be used at the explicit direction of SunGard customer
support or programming personnel. The use of this keyword causes an entire processing job to
terminate.
Subroutine
Subroutine allows the programmer to invoke blocks of Omniscript statements from multiple points
in a Omniscript. Following are the three basic subroutine instructions,
PERFORM – Executes the statements inside the PERFORM instruction before executing
the rest of the statements. Eg: PERFORM ‘ENROLLMENT ‘;
ROUTINE – Contains the subroutine name. Ex: ROUTINE ‘ENROLLMENT’;
GOBACK - Redefines the process flow to the first statement after the following
PERFORM instruction.
Following is an example
EACH@***;
WF001=PF040;
PERFORM 'ALLOC.CHECK';
IF (WK007=1);
WK008=+1;
END;
ENDEACH;
IF (WK008>0);
TM001='INVEST % NOT 25% INCRMENTS';
END;
ROUTINE 'ALLOC.CHECK';
WK007=1;
IF (WF001=0.00) OR
(WF001=0.25) OR
Page 47 Of 92
Controlled copy Omniscripting Induction Manual
(WF001=0.50) OR
(WF001=0.75) OR
(WF001=1.00);
WK007=0;
END;
GOBACK;
Initiates an 'EACH@' statement for all funds. Sets work fund WF001 to the value of the
allocation percentages on file for the participant (PF040).
Instructs the Omniscript to execute the 'ALLOC.CHECK' subroutine, which is defined at
the bottom of the Omniscript.
After executing the 'ALLOC.CHECK', the error flag (WK007) is examined. If the flag is
equal to '1', the error counter (WK008) is incremented by '1'.
Examines the error counter (WK008). If it is greater than '0', outputs the warning
message that the investment allocations are not in increments of 25%.
Defines the 'ALLOC.CHECK' routine. In this routine, WK007 is initialized to the error
setting. Then the participant allocations are examined to ensure that the are in
increments of 25%. If they are, the error setting is changed back to '0'.
Instructs the Omniscript to return to the first statement after the 'PERFORM' instruction.
Page 48 Of 92
Controlled copy Omniscripting Induction Manual
Omniscript business object functions refer to the built in functions to access the various business
objects available in Omniplus under Components menu. Also, this chapter addresses the various
operations that can be performed in conjunction with the various business objects.
Page 49 Of 92
Controlled copy Omniscripting Induction Manual
Record)
Service (OmniDBEN Service
CACAOBJ Cash (Cash Account) SVSTOBJ * History)
CACHOBJ Cash (Cash History) HISHOBJ * History (Sequential History File)
CACPOBJ Cash (Cash Pointer) SSSAOBJ OmniTrade (Share Account)
CKCDOBJ Check (Check Detail) SSSHOBJ OmniTrade (Share History)
CKCKOBJ Check (Check Header) SSSROBJ OmniTrade (Share Request)
CMCMOBJ Compensation TRTHOBJ OmniTrade (Trade History)
CMSLOBJ Compensation (Salary) TRTOOBJ OmniTrade (Trade Order)
PLCOOBJ Plan (Compliance) PTAFOBJ Participant (Annual Financial)
PLCSOBJ Plan (Compliance) PTPHOBJ Participant (Participant Header)
TALMOBJ Tax and Compliance Limits PEPEOBJ Person
DBDBOBJ Disbursements PLPLOBJ Plan
Disbursements (Deduction
DBDGOBJ Groups) PMPMOBJ Product Master
Disbursements (Deduction
DBDHOBJ Headers) PRDROBJ Price (Daily Rate)
DBROOBJ Disbursements (Rollovers) PRPROBJ Price (Price Header)
Distributions (Minimum
DIMDOBJ Distributions) RRRROBJ Rate of Return
DIROOBJ Distributions (Rollovers) RPRHOBJ Reports (UCOM Report Header)
DISGOBJ Distributions (Source Group) RPRPOBJ Reports (UCOM Report Page)
DSDSOBJ Division/Subsidiary SVSVOBJ Service
Forecasting (Forecasting
FRFAOBJ Projection Annuity) PTPSOBJ Source (Participant Source)
Forecasting (Forecasting
FRFBOBJ Beneficiary) SOSCOBJ Source (Source Control)
Forecasting (Forecasting
FRFPOBJ Projection) SAEPOBJ Sub-Accounting (GIC Processing)
Forecasting (Forecasting
FRFROBJ Header) SAGIOBJ Sub-Accounting (GIC Base Text)
HIFXOBJ Foreign Exchange History SAILOBJ Sub-Accounting (Investor Lots)
XRXROBJ Exchange Rate SPSPOBJ SubPlan
Fund (Fund Activity and
FNFCOBJ Fund Control) TXOBJ Textfile (Headers and Records)
Page 50 Of 92
Controlled copy Omniscripting Induction Manual
PTPFOBJ Fund (Participant Fund) TXTFOBJ Textfile (Textfile Header)
BAFMOBJ File Maintenance TXTXOBJ Textfile (Textfile Record)
HIBROBJ History (Base Record) VTFHOBJ Transactions (File Header)
History (EFT Transfer
HIETOBJ History) VTTDOBJ Transactions (Transaction Detail)
ININOBJ Installments VTTLOBJ Transactions (Transaction Log)
PIEVOBJ Insurance (Participant Event) VTTPOBJ Transactions (Transaction Pointer)
PIPDOBJ Insurance (Participant Detail) VTTSOBJ Transactions (Transaction Submit)
Investment (Investment
IVIAOBJ Action) XFEQOBJ Transfer (Equity Wash)
IVICOBJ Investment PTVROBJ Voice Response
LNLFOBJ Loans (Loan Fund)
Purpose
The following section gives basic information common to all OBJ type function libraries. See the
particular OBJ library for detailed information particular to that record (e.g. _VIEW parameters).
The xxyyOBJ modules provide OmniScript access to the records and other structures of
OmniPlus. Each OmniPlus object (e.g. record type) will have a xxyyOBJ module to access the
instance (record), and the individual Data Elements in it. In addition, an xxOBJ module may exist
to reference the entire (Virtual) object.
Example
TXTFOBJ and TXTXOBJ function reference textfile header and textfile data records.
* Delete the specified textfile header record, but not the associated detail (lines)
TXTFOBJ_DELETE(PLAN:'111111' FILENAME:'TEST.TEXTFILE');
TXOBJ references the entire textfile (header plus all detail lines).
* Delete the textfile header record and all textfile detail (lines)
TXOBJ_DELETE(PLAN:'111111' FILENAME:'TEST.TEXTFILE');
Page 51 Of 92
Controlled copy Omniscripting Induction Manual
Terms and Definitions
VIEW - Identifies criteria selecting a set of records for following sequential processing (usually via
NEXT operations).
OBJID - Object ID is a TEXT field identifying the object. The _OBJID operation of data structure
libraries returns this text field. OBJID’s are readable, and can be displayed to uniquely identify the
object, or extracted/stored and later used to re-fetch the object. OBJID’s may be passed as
parameters in VIEW or GET operations to provide key fields.
Page 52 Of 92
Controlled copy Omniscripting Induction Manual
Error Return an error code
Page 53 Of 92
Controlled copy Omniscripting Induction Manual
Validate2 Verify all “foreign keys” are valid
The VIEW operation sets the scope of the records to be returned by following _NEXT operations.
Parameter Fields provided with the _VIEW can identify filters and keys so the user can examine
only the records of interest. If no _VIEW parameters are given, all records on the system
database will be qualified.
Parameters
Parameters fields vary with the particular function library based on the type of record. View
parameters will include each Key field, usually with LO and HI values (e.g.
TRADEDATELO/TRADEDATEHI). Filter parameters may also be allowed, such as STATUS:'31'
or FILTFUND:'**A'. See the individual object for it’s provided filters and key ranges.
Parame Description
ters
[LIMIT:n Limits the maximum number of entries to be returned by _NEXT. May be used to test processes on s
um] volumes. After COUNT is exceeded, succeeding NEXT will return End of File. LIMIT: can be used when testi
to limit accesses to reasonable values.
Example
Parameter Description
Page 54 Of 92
Controlled copy Omniscripting Induction Manual
Parameter Description
[STATUS:t Qualifies only participants with PH-STAT indicating ‘ACTIVE’, ‘INACTIVE’ ‘SUSPENDED’, ‘RETI
x] ‘DEFERRED’, ‘TERMINATED’, and ‘INELIGIBLE’
§ Filter criteria for various key or data fields. (e.g. STATUS:'31' or FUNDFILT:'1**' or
RUNDATELO:19980101)
Parameters
Returns
0 (False) otherwise
Example
PTPHOBJ_FIRST(PLAN:'777777');
Parameters
None
Page 55 Of 92
Controlled copy Omniscripting Induction Manual
Returns
After a successful _NEXT, there is a current record with which to perform record or data element
operations.
Note:If [Limit] is used and qualifying records exist beyond the set limit, _Next will terminate and
load SD101 with ‘Exceeded Given Limit’, SD100 with a ‘4’.
Example
PTPHOBJ_VIEW(PLAN:'777777');
OCSHOW(PTPHOBJ_DE("NAME"));
ENDLOOP;
Return previous instance within a VIEW. A previous VIEW operation is required. This operation is
identical to NEXT, except that records are read in reverse order.
Note: The PREV operation is only valid on the Windows and UNIX platforms. The PREV
operation is not available on the Mainframe (MVS) platform.
Note: The PREV operation is currently only valid with the following Object Access Functions:
BAI2OBJ, CMCMOBJ, CMSLOBJ, DNCROBJ, DNPBOBJ, DNPNOBJ, HIBROBJ, PLPLOBJ,
PTPHOBJ, SVSTOBJ, and SVSVOBJ.
Parameters
None
Returns
After a successful _PREV, there is a current record with which to perform record or data element
operations.
Example
PTPHOBJ_VIEW(PLAN:'777777');
OCSHOW(PTPHOBJ_DE("NAME"));
ENDLOOP;
Page 56 Of 92
Controlled copy Omniscripting Induction Manual
_LAST – Access the last qualified record
Note: The LAST operation is currently only valid with the following Object Access Functions:
BAI2OBJ, CMCMOBJ, CMSLOBJ, DNCROBJ, DNPBOBJ, DNPNOBJ, HIBROBJ, PLPLOBJ,
PTPHOBJ, SVSTOBJ, and SVSVOBJ.
Parameters
Returns
0 (False) otherwise
Example
PTPHOBJ_LAST(PLAN:'777777');
Executes a VIEW and then NEXT functions, counting each record, returning the total number of
qualified records.
Parameters
Returns
Example
WK001=PTPHOBJ_COUNT(PLAN:'777777');
Note: _COUNT does in fact pass all qualified records to count them. For performance reasons,
you should only use _COUNT if you will not pass the records yourself with _VIEW/_NEXT. If you
will process the records, it will be more efficient (especially for large record counts) to tally the
records yourself as you process them; otherwise passing the records twice will be inefficient.
The RecAreaPresent operation will return 1/true if an INIT was performed or a record was fetched
using a GET, NEXT, or similar operation. RecAreaPresent will return 0/false if either no operation
Page 57 Of 92
Controlled copy Omniscripting Induction Manual
has been done to establish the record area or the prior GET, NEXT or similar operation failed.
Note that RecAreaPresent does not necessarily indicate that the record exists on the database. A
previous SETDE operation may have changed a key field on the record, or the record area may
have been established by an INIT operation.
Alias
Returns
0 (False) otherwise
Example
If TALMOBJ_RecAreaPresent()=False;
TALMOBJ_Get(Year:2005);
End;
End;
INITIALIZE function to clear all fields in the current record. Can be used prior to valuing fields for
an Add/Write operation. Clears each field in the instance (record).
Parameters
Example
PTVROBJ_INIT(PLAN:'777777' PARTID:PH007);
PTVROBJ_SETDE(DENUM:100 VALUE:'5789');
PTVROBJ_SETDE(DENUM:105 VALUE:4);
PTVROBJ_ADD();
Page 58 Of 92
Controlled copy Omniscripting Induction Manual
Parameters
None
Returns
Example
PTPHOBJ_VIEW(PLAN:SD001);
PTPHOBJ_NEXT();
TX001=PTPHOBJ_OBJID();
Parameters
Returns
Example
PTPHOBJ_GET(PLAN:'111111' PARTID:'222222222');
Get greater than or equal to (>=) using specified Key fields or OBJID
Parameters
Example
PTPHOBJ_GETGE(PLAN:'777777' PARTID'000000001');
TX001=PTPHOBJ_OBJID();
Page 59 Of 92
Controlled copy Omniscripting Induction Manual
Parameters
Parameters
Note: The GETLT and GETGT operations are not currently valid with the following Objects:
VTRAN and Share/Trade.
Note: The GETLT operation is not available on the Mainframe (MVS) platform.
Parameters
Returns
Example
IF DSDSOBJ_GET(PLAN:'777777' DIVSUB:'1234');
DSDSOBJ_DELETE();
TX001='REC DELETED';
ELSE;
TX001='DELETE FAILED';
END;
Copy specified occurrence, using given Key fields. Makes a copy of the current record, and writes
it using the given new Key fields.
Parameters
Page 60 Of 92
Controlled copy Omniscripting Induction Manual
Returns
Note: If [Plan:] or [Partid:] is not coded for a new plan or participant, SD101 will be loaded with
‘Cannot copy onto self’.
Example
IF PTPHOBJ_GET(PLAN:'777777' PARTID:'444000000');
/* copy the current PTPH record from plan 777777 to plan 777780 */
PTPHOBJ_COPY(PLAN:'777780');
ELSE;
TX001='COPY FAILED';
END;
Parameters
Returns
Example
IF PTPHOBJ_GET(PLAN:'777777' PARTID:'444000000');
PTPHOBJ_MOVE(PLAN:'777780');
ELSE;
TX001='MOVE FAILED';
END;
Parameters
None
Page 61 Of 92
Controlled copy Omniscripting Induction Manual
Returns
Example
DSDSOBJ_VIEW(PLAN:'777780');
DSDSOBJ_SETDE(DENUM:200 VALUE:1);
DSDSOBJ_UPDATE();
ENDLOOP;
Note: This function cannot be used to change the Key fields of a record.
Parameters
None
Returns
Example
PTVROBJ_INIT(PLAN:SD001 PARTID:PH007);
PTVROBJ_SETDE(DENUM:100 VALUE:'5789');
PTVROBJ_SETDE(DENUM:105 VALUE:4);
PTVROBJ_ADD();
Parameters
None
Returns
1 (True) if the last IO operation terminated in error, 0 (False) if the last IO operation was
successful
Example
Page 62 Of 92
Controlled copy Omniscripting Induction Manual
WK001=PLPLOBJ_ERROR(); /* WK001 might be 0 indicating success, or 1 indicating no such
record */
Parameters
None
Returns
A TEXT message containing the File Status and a description of the last IO completion FILE-
STATUS
Example
Parameters
None
Returns
Example
Returns: 'AltAddr'
Parameters
None
Returns
Example
Page 63 Of 92
Controlled copy Omniscripting Induction Manual
Returns: 'Participant Header'
Parameters
None
Returns
Example
Fetch Text value of the specified Data Element. If necessary, converts a numeric element to it’s
TEXT equivalent using its default format. If the actual numeric value is wanted, use _NUMDE to
fetch it.
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
Page 64 Of 92
Controlled copy Omniscripting Induction Manual
name only: “RecordLength”, “KeyLength”.
Returns
Examples
PTPHOBJ_GET(PLAN:'777777' PARTID:'1230004567');
TX001=PTPHOBJ_DE(011);
/* OR */
TX001=PTPHOBJ_DE('NAME');
/* OR */
TX001=PTPHOBJ_DE('naMe');
/* OR */
TX001=PTPHOBJ_DE(NAME:'011');
/* OR */
TX001=PTPHOBJ_DE(NAME:'DE011')
/* OR */
TX001=PTPHOBJ_DE(NAME:'PH011');
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Page 65 Of 92
Controlled copy Omniscripting Induction Manual
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
Example
PTPHOBJ_VIEW(PLAN:'777777');
PTPHOBJ_NEXT();
TX001=PTPHOBJ_NUMDE('SALARY');
/* OR */
TX001=PTPHOBJ_NUMDE(170);
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Followed by:
Parameter Description
Page 66 Of 92
Controlled copy Omniscripting Induction Manual
Returns
Note: Returns SD101 loaded with ‘No Such Data Element: DE999’ if requested DE doesn’t exist.
Returns SD101 loaded with ‘Mismatched Data Type: DE999’ for attempts to give numeric data
elements text values (or vice versa).
Example
PTPHOBJ_VIEW(PLAN:'777777');
PTPHOBJ_NEXT();
PTPHOBJ_SETDE(015 '100044');
/* OR */
PTPHOBJ_SETDE(DENUM:015 VALUE:'100044');
/* OR */
PTPHOBJ_SETDE(NAME:'EMPL-NUM' VALUE:'100044');
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
‘ ‘ (Primary), ‘A’ (Artificial), ‘C’ (Composite), ‘P’ (Part of), ‘R’ (Redefinedl), ‘F’ (Fixed)
TX010=PTAIOBJ_DEATTRIBUTE(210);
Page 67 Of 92
Controlled copy Omniscripting Induction Manual
Returns: C
Return the # of bytes required to show a data element. For Text elements, this will be the # of
bytes. For numeric elements, it will be the total formatted length, including any formatting
characters such as commas, decimals, signs, slashes, etc. This operation should be used for
output formatting (such as HTML screens or reports) where it is necessary to get the formatted
length of a field.
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
Example
WK001=PTPHOBJ_DEFMTVAL(170);
Adds HTML code to the OmniScript clipboard to format a data element as a pre-valued HTML
FORM input field. For data elements with multiple legal values, this would return the HTML code
for a drop down menu. This operation is useful when generating HTML FORM code using
OmniScript.
Refer to OCCLIP documentation for more information on the OmniScript Clipboard Facility.
Page 68 Of 92
Controlled copy Omniscripting Induction Manual
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
The number of lines added to the clipboard. (HTML text is appended to the current clipboard
contents).
Example
TX001 = PTPHOBJ_DeHtmInp(030);
/*
<select name="PTPH030">
<option select="1">Male</option>
<option select="2">Female</option>
</select>
*/
TX001 = PTPHOBJ_DeHtmInp(011);
/*
Page 69 Of 92
Controlled copy Omniscripting Induction Manual
*/
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
‘ ‘ (Primary), ‘A’ (Artificial), ‘C’ (Composite), ‘P’ (Part of), ‘R’ (Redefinedl), ‘F’ (Fixed)
TX004=DBDBOBJ_DELABEL(160);
Returns: DistType
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
Page 70 Of 92
Controlled copy Omniscripting Induction Manual
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
TX005=FNFCOBJ_DEISKEY(026);
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Example
Return the next highest Valid DE number for this record. DENEXT can be used to sequentially
fetch all the elements for a record, in data element order.
Parameters
Parameter Description
Page 71 Of 92
Controlled copy Omniscripting Induction Manual
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
The next highest valid Data Element number for this record
Example
WK001= PTPHOBJ_DENEXT(0);
WK001=PTPHOBJ_DENEXT(WK1);
ENDLOOP;
Returns the internal Picture of the specified data element, such as “N11D00” or “X40”. See the
OmniPlus Data Element overview for an explanation of OmniPlus element pictures. Refer also to
the DETYPE operation.
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
Page 72 Of 92
Controlled copy Omniscripting Induction Manual
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
Example
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
TX007=PTPFOBJ_DERDBNUM(170);
Returns: 32
Returns the DE number that the defined DE is a part of (redefined and part of de’s).
Parameters
Parameter Description
Page 73 Of 92
Controlled copy Omniscripting Induction Manual
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
TX006=NTNHOBJ_DERELATED(105);
Returns: 100
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
Page 74 Of 92
Controlled copy Omniscripting Induction Manual
Example
TX001=PTPHOBJ_DETYPE(007);
* Returns: 'X'
/* OR */
TX001=PTPHOBJ_DETYPE(DENUM:170);
* Returns: 'N'
This operation is used to display the legal values for data elements that have multiple legal
values. In OmniStation, these data elements show as a “pull down menu” with all of the legal
values displayed. This operation returns the text description for the specified legal value for the
specified data element. Refer also to the DeValKey operation.
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
And
Parameter Description
Returns
Page 75 Of 92
Controlled copy Omniscripting Induction Manual
Example
* Get the first legal value and it’s description for PH023
TX001=PTPHOBJ_DEVALDESC(141 INDEX:1);
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Returns
This operation is used to display the legal values for data elements that have multiple legal
values. In OmniStation, these data elements show as a “pull down menu” with all of the legal
values displayed. This operation returns the text value of the specified element’s value. Refer
also to the DeValDesc and DeValKeyN operations.
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
Page 76 Of 92
Controlled copy Omniscripting Induction Manual
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
And
Parameter Description
Returns
Example
WK001=1;
LOOP;
TX001=PTPHOBJ_DEVALKEY(023 INDEX:WK001);
WK001=+1;
ENDLOOP;
Refer to the DeValKey operation. Returns the numeric value of a data element’s legal value.
Example
WK001=PTPHOBJ_DEVALKEYN(023 INDEX:WK001);
This operation is used to display the legal values for data elements that have multiple legal
values. In OmniStation, these data elements show as a “pull down menu” with all of the legal
Page 77 Of 92
Controlled copy Omniscripting Induction Manual
values displayed. This operation returns the descriptive value associated with the data element’s
current value.
Parameters
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
name only: “RecordLength”, “KeyLength”.
Example
TX001=PTPHOBJ_DEVALNAME(NAME:'STAT');
General Parameter
Parameter Description
[NAME:]tx The name of the data element (in quotes). The name may be in any of
the following formats:
- The name as it appears on the OmniStation Fields tab
- The data element number in 999 or DE999 format
- The data element in YY999 format, were YY is the record type (e.g.
“PH011”)
(NOTE: This entry is NOT case-sensitive.)
Note that the following values may be accessed by data element
Page 78 Of 92
Controlled copy Omniscripting Induction Manual
name only: “RecordLength”, “KeyLength”.
Formatting Parameters
Parameter Description
‘L’ – DE Label
Example: ATTRIBS:’#N’
Page 79 Of 92
Controlled copy Omniscripting Induction Manual
‘L’ – DE Label
Example: NODES:’#ND’
Returns
Examples
Page 80 Of 92
Controlled copy Omniscripting Induction Manual
Clipboard Operations
Refer to OCCLIP documentation for more information on the OmniScript Clipboard Facility.
Copies the current record to the clipboard as formatted text, replacing existing clipboard contents.
This text may include all data element or only valued data elements. A wide variety of XML
formats and options are available. Refer to the DeXML operation for more information.
General Parameter
Parameter Description
1 – All elements
For example, if NODEID:’MyRec’ was specified, the XML text would contain
<MyRec>
</MyRec>
Formatting Parameters
Additional Formatting parameters are allowed to control the format of the data. These parameters
are documented under the DeXML operation above.
Returns
The number of data elements copied to the clipboard. Zero if no none were selected or a
clipboard error occurred.
Example
OCSHOW_FROMCLIP(); /* or */ OCFILE1_FROMCLIP();
<PARTICIPANT>
Page 81 Of 92
Controlled copy Omniscripting Induction Manual
<PartNumX> 123456789 </PartNumX>
<Stat> 00 </Stat>
</PARTICIPANT>
This operation is identical to the TOCLIP operation, except that the current record is appended to
the clipboard, instead of replacing the clipboard contents.
Other Operations
Checks each field on the record to insure valid values (e.g. Flags, valid Dates, etc.), confining the
checks to inspecting this particular instance.
Parameters
None
Returns
Note: If invalid, SD100 will contain the DE number found to be invalid, and SD101 will contain a
reason message.
Verify all ‘foreign keys’ are valid. Accesses other records in the system to verify the proper
relationship to this record. For example, PTPHOBJ_VALIDATE2 would insure the specified Plan
exists, the specified Participant exists, the specified Fund is valid for the plan.
Parameters
None
Returns
Note: If invalid, SD100 will contain the DE number found to be invalid, and SD101 will contain a
reason message.
Page 82 Of 92
Controlled copy Omniscripting Induction Manual
Omniscript Utility functions are tailor-made functions which aids in performing text, numeric
manipulations and other calculations.
Page 83 Of 92
Controlled copy Omniscripting Induction Manual
OCCLEAR Initialize OmniScript Field Values OmniScript
OCCSV Interface with Comma Separated Values (.CSV) formatted data OmniScript
OCFILB External File Read and Write Access (Byte Stream Files) OmniScript
OCFILV External File Read and Write Access (Wide Files) OmniScript
OCFMT Format Numeric Fields into Text with Given Picture OmniScript
Page 84 Of 92
Controlled copy Omniscripting Induction Manual
OCSCRIPT OmniScript Execution Facility OmniScript
Script -I
* /* Fetch all SSNs <59.06 in Non-Roth plans */
CALC SECTION
IF OCFILE1_OPEN(NAME:'$FILE1' MODE:'INPUT')=0; /* OPEN INPUT FILE
*/
DISPLAY 'OPEN FAILED INPUT FILE OCFILE1';
ABEND;
ENDIF;
Page 85 Of 92
Controlled copy Omniscripting Induction Manual
IF OCFILE2_OPEN(NAME:'$FILE2' MODE:'OUTPUT')=0; /* OPEN OUTPUT
FILE */
DISPLAY 'OPEN FAILED OUTPUT FILE OCFILE2';
ABEND;
ENDIF;
LOOP WHILE OCFILE1_READ(INTO:TX110);/*Area to read record into*/
TX001=OCSUB(TX110 1 6); /* Read Plan # from the text input file */
SOSCOBJ_VIEW(PLAN:TX001);
LOOP WHILE SOSCOBJ_NEXT();
TX002=SOSCOBJ_DE(229); /* Read the Roth Indicator */
IF (TX002!='1'); /* If plan is Non-Roth */
PTPHOBJ_VIEW(PLAN:TX001 PART:PTPHOBJ_DE(007));
LOOP WHILE PTPHOBJ_NEXT();
TX003=PTPHOBJ_DE(007); /* Read SSN */
TX004=PTPHOBJ_DE(021); /* Read SSN Status*/
TX005=PTPHOBJ_DE(050);/*DoB*/
WK001=OCDATE_CURRENT(); /* Returns the current System date */
WK002=OCTEXT_TONUM(TX005);/*Convert DoB to Numeric*/
WK003=OCDATE_DIFFYMD(WK002 WK001);/*Return diff in YYMMDD*/
TX007=WK003;
TX008=ocTEXT_CONVERT(TX007 From:"/" To:".");
TX009=OCTEXT_SET(TX008 3 '.' 1); /*Inserts chars to a text string*/
TX010=OCTEXT_SET(TX008 5 '.' 1);
TX011=OCTEXT_STRING(TX009 TX010); /*Concatenate Text Strings into one*/
TX012=OCTEXT_SUB(TX011 1 4); /*Return a portion of a string*/
OCSHOW(TX009);
OCSHOW(TX010);
OCSHOW(TX011);
OCSHOW(TX012);
IF (TX003='00') AND (TX012<'59.06'); /* Check for Active Status SSNs */
TX013=TX001+'|'+TX003+'|'+TX004+'|'+TX005+'|'+TX012+'|'+TX002;
OCFILE2_WRITE(TX013);
ENDIF;
ENDLOOP;
ENDIF;
ENDLOOP;
ENDLOOP;
Script -II
* /* Fetch all SSNs <59.06 in Roth plans */
CALC SECTION
IF OCFILE1_OPEN(NAME:'$FILE1' MODE:'INPUT')=0; /* OPEN INPUT FILE
*/
DISPLAY 'OPEN FAILED INPUT FILE OCFILE1';
ABEND;
Page 86 Of 92
Controlled copy Omniscripting Induction Manual
ENDIF;
IF OCFILE2_OPEN(NAME:'$FILE2' MODE:'OUTPUT')=0; /* OPEN OUTPUT
FILE */
DISPLAY 'OPEN FAILED OUTPUT FILE OCFILE2';
ABEND;
ENDIF;
LOOP WHILE OCFILE1_READ(INTO:TX110);/*Area to read record into*/
TX001=OCSUB(TX110 1 6); /* Read Plan # from the text input file */
SOSCOBJ_VIEW(PLAN:TX001);
LOOP WHILE SOSCOBJ_NEXT();
TX002=SOSCOBJ_DE(229); /* Read the Roth Indicator */
IF (TX002='1'); /* If plan is Roth */
PTPHOBJ_VIEW(PLAN:TX001 PART:PTPHOBJ_DE(007));
LOOP WHILE PTPHOBJ_NEXT();
TX003=PTPHOBJ_DE(007); /* Read SSN */
TX004=PTPHOBJ_DE(021); /* Read SSN Status*/
TX005=PTPHOBJ_DE(050);/*DoB*/
WK001=OCDATE_CURRENT(); /* Returns the current System date */
WK002=OCTEXT_TONUM(TX005);/*Convert DoB to Numeric*/
WK003=OCDATE_DIFFYMD(WK002 WK001);/*Return diff in YYMMDD*/
TX007=WK003;
TX008=ocTEXT_CONVERT(TX007 From:"/" To:".");
TX009=OCTEXT_SET(TX008 3 '.' 1); /*Inserts chars to a text string*/
TX010=OCTEXT_SET(TX008 5 '.' 1);
TX011=OCTEXT_STRING(TX009 TX010); /*Concatenate Text Strings into one*/
TX012=OCTEXT_SUB(TX011 1 4); /*Return a portion of a string*/
OCSHOW(TX009);
OCSHOW(TX010);
OCSHOW(TX011);
OCSHOW(TX012);
IF (TX003='00') AND (TX012<'59.06'); /* Check for Active Status SSNs */
TX013=TX001+'|'+TX003+'|'+TX004+'|'+TX005+'|'+TX012+'|'+TX002;
OCFILE2_WRITE(TX013);
ENDIF;
ENDLOOP;
ENDIF;
ENDLOOP;
ENDLOOP;
Script -III
* /* Fetch all SSNs >59.06 in plans that allow Inservice Wdrls */
CALC SECTION
IF OCFILE1_OPEN(NAME:'$FILE1' MODE:'INPUT')=0; /* OPEN INPUT FILE
*/
DISPLAY 'OPEN FAILED INPUT FILE OCFILE1';
Page 87 Of 92
Controlled copy Omniscripting Induction Manual
ABEND;
ENDIF;
IF OCFILE2_OPEN(NAME:'$FILE2' MODE:'OUTPUT')=0; /* OPEN OUTPUT
FILE */
DISPLAY 'OPEN FAILED OUTPUT FILE OCFILE2';
ABEND;
ENDIF;
LOOP WHILE OCFILE1_READ(INTO:TX110);/*Area to read record into*/
TX001=OCSUB(TX110 1 6); /* Read Plan # from the text input file */
BAUDOBJ_VIEW(PLAN:TX001 PARTID:'000000000' BTTYPE:'UIDB');
LOOP WHILE BAUDOBJ_NEXT();
TX002=BAUDOBJ_DE(400);/*Chk for Inservice Wdrl Plans*/
TX003=OCSUB(TX003 1 1);
IF(TX003='1');/* If plans allows Inservice Wdrl*/
PLPLOBJ_VIEW(PLAN:TX001);
LOOP WHILE PLPLOBJ_NEXT();
TX004=PLPLOBJ_DE(646); /*spousal Consent Indicator*/
TX005=OCSUB(TX004 7 1);
IF(TX005='0') OR (TX005='2') OR (TX005='3') OR (TX005='4') OR (TX005='5') OR
(TX005='6') OR (TX005='7') OR (TX005='8');
PTPHOBJ_VIEW(PLAN:TX001 PART:PTPHOBJ_DE(007));
LOOP WHILE PTPHOBJ_NEXT();
TX006=PTPHOBJ_DE(007); /* Read SSN */
TX007=PTPHOBJ_DE(021); /* Read SSN Status*/
TX008=PTPHOBJ_DE(050);/*DoB*/
WK001=OCDATE_CURRENT(); /* Returns the current System date */
WK002=OCTEXT_TONUM(TX008);/*Convert DoB to Numeric*/
WK003=OCDATE_DIFFYMD(WK002 WK001);/*Return diff in YYMMDD*/
TX009=WK003;
TX010=ocTEXT_CONVERT(TX009 From:"/" To:".");
TX011=OCTEXT_SET(TX010 3 '.' 1); /*Inserts chars to a text string*/
TX012=OCTEXT_SET(TX010 5 '.' 1);
TX013=OCTEXT_STRING(TX011 TX012); /*Concatenate Text Strings into one*/
TX014=OCTEXT_SUB(TX013 1 4); /*Return a portion of a string*/
OCSHOW(TX010);
OCSHOW(TX011);
OCSHOW(TX012);
OCSHOW(TX013);
OCSHOW(TX014);
IF (TX003='00') AND (TX012>'59.06'); /* Check for Active Status SSNs */
TX015=TX001+'|'+TX003+'|'+TX005+'|'+TX006+'|'+TX007+'|'+TX008+'|'+TX014
OCFILE2_WRITE(TX013);
ENDIF;
ENDLOOP;
ENDIF;
ENDLOOP;
Page 88 Of 92
Controlled copy Omniscripting Induction Manual
ENDIF;
ENDLOOP;
ENDLOOP;
Script -IV
* /* Fetch all SSNs which allows Loan Issue for Spousal consent */
CALC SECTION
IF OCFILE1_OPEN(NAME:'$FILE1' MODE:'INPUT')=0; /* OPEN INPUT FILE
*/
DISPLAY 'OPEN FAILED INPUT FILE OCFILE1';
ABEND;
ENDIF;
IF OCFILE2_OPEN(NAME:'$FILE2' MODE:'OUTPUT')=0; /* OPEN OUTPUT
FILE */
DISPLAY 'OPEN FAILED OUTPUT FILE OCFILE2';
ABEND;
ENDIF;
LOOP WHILE OCFILE1_READ(INTO:TX110);/*Area to read record into*/
TX001=OCSUB(TX110 1 6); /* Read Plan # from the text input file */
PLPLOBJ_VIEW(PLAN:TX001);
LOOP WHILE PLPLOBJ_NEXT();
TX002=PLPLOBJ_DE(646); /*spousal Consent Indicator*/
TX003=OCSUB(TX002 4 1);
TX004=PLPLOBJ_DE(602); /*Loan Application Fee*/
TX005=OCSUB(TX002 7 1);
IF(TX003='3') AND (TX004<>' ') AND (TX005='0');/* If plans allows Spousal Consent
for Loan Issuance*/
PTPHOBJ_VIEW(PLAN:TX001);
LOOP WHILE PTPHOBJ_NEXT();
TX008=PTPHOBJ_DE(007);/*SSN*/
TX006=PTPHOBJ_DE(633); /* Spousal Consent Form Date*/
TX007=OCSUB(TX006 11 8);
IF(TX007=' ');
LNLHOBJ_VIEW(PLAN:TX001 PARTID:TX008);
LOOP WHILE LNLHOBJ_NEXT();
TX009=LNLHOBJ_DE(325);/*Payroll Code*/
IF(TX009='PDED');
TX010=TX001+'|'+TX003+'|'+TX004+'|'+TX005+'|'+TX008+'|'+TX007+'|'+TX009
OCFILE2_WRITE(TX010);
ENDIF;
ENDLOOP;
ENDIF;
ENDLOOP;
ENDIF;
ENDLOOP;
Page 89 Of 92
Controlled copy Omniscripting Induction Manual
ENDLOOP;
Script -V
* /* Fetch all SSNs with specific Loan Repayment codes & Frequency */
PARM SECTION
OR_RPT_MODE=CALC
OR_DELIMITER='~'
OR_AUTO_PAGE_BREAK=YES
OR_PAGE_LENGTH=50
TEXT SECTION
PLAN SSN# LH405(Loan Status) LH325(Payroll Code)
LH318(Repmt Freq) FLAG>>CS,OR1=0 >>L1
--------------------------------------------------------------------->>CE
>TX1 >TX2 >TX3 >TX4 >TX5
>>CS,OR2=0>>CE
CALC SECTION.
OR_AREA_1_ON;
SD080=099999;
PLPLOBJ_VIEW();
LOOP WHILE PLPLOBJ_NEXT();
TX001=PLPLOBJ_DE(011);/* Plan #*/
PTPHOBJ_VIEW();
LOOP WHILE PTPHOBJ_NEXT();
TX002=PTPHOBJ_DE(007);/* Plan #*/
LNLHOBJ_VIEW(PLAN:TX001 PARTID:TX002)
LOOP WHILE LNLHOBJ_NEXT();
TX003=LNLHOBJ_DE(405); /* Loan Status*/
TX004=LNLHOBJ_DE(325); /* Loan Status*/
TX005=LNLHOBJ_DE(318); /* Loan Status*/
IF(TX003='0') AND (TX004='COUP') AND(TX005='3');
OR_AREA_2_ON;
OR_RPT_GEN;
ENDIF;
ENDLOOP;
ENDLOOP;
ENDLOOP;
Div/Sub Scan
SD80=99999999;/*To perform the number of loops*/
IF OCFILE1_OPEN(NAME:'$FILE1' MODE:'INPUT')=0; /* OPEN OUTPUT
FILE */
DISPLAY 'OPEN FAILED INPUT FILE OCFILE1';
ABEND;
ENDIF;
Page 90 Of 92
Controlled copy Omniscripting Induction Manual
IF OCFILE2_OPEN(NAME:'$FILE2' MODE:'OUTPUT')=0; /* OPEN OUTPUT
FILE */
DISPLAY 'OPEN FAILED OUTPUT FILE OCFILE2';
ABEND;
ENDIF;
LOOP WHILE OCFILE1_READ(INTO:TX050);
TX001=OCSUB(TX050 1 6);
DSDSOBJ_VIEW(PLAN:TX001);
LOOP WHILE DSDSOBJ_NEXT();
TX002=DSDSOBJ_DE(007);
TX003=TX001+':'+TX002;
OCFILE2_WRITE(TX003);
ENDLOOP;
ENDLOOP;
Page 91 Of 92
Controlled copy Omniscripting Induction Manual
TX014=HIBROBJ_DE(007);/*SSN*/
IF (TX004='165');
TX013=TX001+'|'+TX011+'|'+TX004+'|'+TX005+'|'+TX003+'|'+TX012+'|'+TX007+'|'+T
X008+'|'+TX009+'|'+TX010;
OCSHOW(TX013);
OCFILE2_WRITE(TX013);
ENDIF;
ENDLOOP;
ENDLOOP;
ENDLOOP;
Page 92 Of 92