100% found this document useful (2 votes)
1K views92 pages

GM 3

This document provides an overview of Omniscript, a scripting language used for the Retirement Services record keeping system Omniplus. It describes the different sections of an Omniscript program including the PARM, TEXT, and CALC sections. The PARM section specifies reporting features. The TEXT section formats output values. The CALC section contains calculations and conditional logic.

Uploaded by

Sarath Ch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
1K views92 pages

GM 3

This document provides an overview of Omniscript, a scripting language used for the Retirement Services record keeping system Omniplus. It describes the different sections of an Omniscript program including the PARM, TEXT, and CALC sections. The PARM section specifies reporting features. The TEXT section formats output values. The CALC section contains calculations and conditional logic.

Uploaded by

Sarath Ch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 92

Controlled copy Omniscripting Induction Manual

Omniscripting Induction Manual

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

CHAPTER 1 – OMNISCRIPT OVERVIEW.....................................................................................4

CHAPTER 2 – OMNISCRIPT STRUCTURE..................................................................................6

CHAPTER 3 – OMNISCRIPT COMMENTS & VARIABLES........................................................11

CHAPTER 4 – OMNISCRIPT OPERATORS...............................................................................34

CHAPTER 5 – OMNISCRIPT PROGRAMMING STMTS.............................................................38

CHAPTER 6 – OMNISCRIPT BUSINESS OBJECT FUNCTIONS..............................................50

CHAPTER 7 – OMNISCRIPT UTILITY FUNCTIONS...................................................................84

CHAPTER 8 – Omniscript Examples............................................................................................ 86

Page 3 Of 92
Controlled copy Omniscripting Induction Manual

CHAPTER 1 – Omniscript Overview

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.

2. In Omniscript, there is no equivalent of PA (as-of PF) functionality. If you need to use


PA’s, you need to do so using the old code instead of the new. Also, Omnicalc will come
in handy for performing complex calculations such as the Dividends / Earnings
calculations.

Following are the essentials to build Omniscripts,

Omniscript Variables / System Defined Functions


Conditional, Looping Statements & Subroutines
Omni Object Access Functions
Omniscript Operators
Omniscript Utility Functions

Page 5 Of 92
Controlled copy Omniscripting Induction Manual

CHAPTER 2 – Omniscript Structure

Following are the various sections available within an Omniscript program,

 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,

DE # FIELD NAME Values Description


N/A OR_RPT_MODE CALC Report Writer Integration method (explicit multiple
T966 generations) SORT- Traditional method (implicit
single generation) This command is REQUIRED if
using Report Writer Integration.
N/A OR_DELIMITER Changes TEXT SECTION delimiter from “_” to value
specified.
N/A OR_AUTO_PAGE_BREAK YES Auto page break is ON
NO Auto page break is OFF
N/A OR_FOOTER_LENGTH Tells the page breaking facility how far from the
bottom of the page to produce the Footer. Must be
valued unless the user is using the Automatic Page
Breaking facility. If the user is using the Automatic
Page Breaking Facility, the length of the footer will be
automatically calculated.  Default is 5 lines.
N/A OR_PAGE_LENGTH Tells the page breaking facility how many lines are
contained within one page.  This field must be set to a
desired page. Default is 50 lines.
OR210 OR_PRINT_FIRST Contains Xerox commands that print before detail
statements.

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,

DE # FIELD NAME Values Description


OR001 OR_AREA_1 Use OR001 or OR_AREA_1 in the Text Section to define
a text 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 Use OR002 or OR_AREA_2 in the Text Section to define
a text 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 Use OR003 or OR_AREA_3 in the Text Section to define
  a text 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 Use OR004 or OR_AREA_4 in the Text Section to define
a text 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 Use OR005 or OR_AREA_5 in the Text Section to define
a text 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

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.

  OR_FOOTER will be produced at the bottom of each new page.

  OR_TOTALS will be produced as the last page of output print.

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,

DE # FIELD NAME Values Description


WK213 OR_SORT_RPT_OPT Sort Sequence Filed that overrides the value entered in
the SORT-REPORT-OPTION-966 field.
WK214 OR_RPT_DATE Refers to DATE-REPORT-966
WK215 OR_RPT_DATE_ALTER Refers to DATE-ALTERNATE-966
WK216 OR_PAGE_NUM Contains the current page number that will be printed in
the Text Section.
WK217 OR_PART_CANADIAN Participant Number (Canadian format 999-999-999). 
Reference only.
  OR_RPT_GEN   Causes OmniScript to issue commands to Report-
Writer to print all Conditional Text Areas which have
been set to ‘ON’. Text Blocks which are not Conditional
Text Blocks will also be printed.  All Conditional Text
Areas will be reset to ‘OFF’ after this command is
issued.
  OR_CURR_LINE   equal to the value of the current line number.
  OR_PAGE_BREAK   causes OmniScript to issue commands to Report-
Writer that will write out the footer, perform a page
break, and set up the header for the next page.  This
keyword is meant to allow user control over page
breaking, and is not meant to be used with the auto

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.

  OR_FOOTER_ON turns the area in the Text Section on.


OR_FOOTER_OFF turns the area in the Text Section off

  OR_TOTALS_ON turns the area in the Text Section on.


OR_TOTALS_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.

CHAPTER 3 – Omniscript Comments & Variables

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.

Example: PTPHOBJ_DE(050); / * Participants Date of Birth * / An example for Informational


Comment.
* TX001=WK002; An example for Non-Executable Statement.

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

WKs cannot accommodate numbers greater than 99,999,999,999.999999. ‘PIC


9(11)V9(6)’.
WKs calculation results can be used multiple times in the same program.
OmniScript contains up to 6200 work fields (WK001 through WK6200). Up to 3000 can
be used with the T966 Custom Report Generator.
All 'WK' Work Fields are reinitialized to zero between participants so that calculations are
performed for each participant (not accumulated for all participants).
WKs can be user defined or predefined by the transaction you are processing. Most
transactions set aside a block of WKs to perform certain tasks. Before creating a
program, you must be familiar with the pre-defined WKs for the transaction

Here’s an example 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.

Key Value Fields(KV)


Key value (KV) fields are used within the OmniScript facility to establish parameters and
qualify the records that are to be accessed and used in OmniScript functions. Individual
records can be accessed, or records can be counted and summed together. Records for
selected files can be added, changed, or deleted. Caution should be exercised when using
'KV' fields because values are defined differently for different types of records. Records types
that use ‘KV’ fields for OmniScript access include, BR, BT, FA, PA and DR.

Following example will illustrate you the use of KV fields


KV001=19990101;

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,

KV001 Trade Date - Low. Low value to be


compared to the trade date in BR008.

KV002 Trade Date - High. High value to be


compared to the trade date in BR008.

KV003 Run Date - Low. Low value to be compared


to the run date in BR009.

KV004 Run Date - High. High value to be compared


to the run date in BR009.

KV005 Run Time - Low. Low value to be compared


to the run time in BR010.

KV006 Run Time - High. High value to be compared


to the run time in BR010.

KV007 Transaction Code. Value to be compared to


the transaction code in BR101.

KV008 Activity Type. Value to be compared to the


activity type in BR102.

Page 13 Of 92
Controlled copy Omniscripting Induction Manual

There are 53 Key Values available in Omni Scripting.

System Defined(SD) Variables


Several categories of System Defined Data Elements have been established for use within
OmniScript. System-defined data elements represent values automatically calculated by the
system that can be used in OmniScript.

 System Defined Values can be used in any OmniScript context.

 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.

 System Defined (SD) data elements consist of:


Storage areas accessed by different functions
Flags that perform various tasks

 Some common uses for SDs include, Date Conversion Facility, OmniScript Text
Substring Facility

Some of the commonly used SD data elements are


1. SD001:- Stores the current plan ID. Can be assigned to a text field to return the
Plan number. Example TX001=SD001; will return the current plan no.
3. SD002:- Stores the current participant on which the code is being executed.
4. TX001=SD002;
will return the current SSN id.
3. SD003:- Stores the current system date. WK001=SD003 will return current system date.
There are bunch of other SD Data elements which return the dates in various formats. Refer
to SD040 to SD043 to find out what more you can do with SD data elements.
5. SD080:- This is one of the most important variables which you will be using most
commonly
6. While doing the Omni Scripting.
SD080 is MAX-LOOP-COUNTER. Overrides for maximum number of times a LOOP will
execute. Default is 500. The maximum value is 999,999,999. So if you wish to run a look

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.

Here’s a complete list of the various SD variables,

Field Literal Alias Field Description Valued By: Format


SD001 SDPlan Current Plan ID System X06
SD002 SDPartNum Current Participant Number System X17
SD003 SDRDate Current System Date. The date at which System N08
the current process started. This value
may be overridden by the OmniPlus
environment variable ENV_RUN-DATE
and related environment variables. This
field is in CCYYMMDD format.
Use OcDate_Current() to retrieve the
actual CPU date
SD004 SDRTime Current Process Start Time. The time at System N06
which the current process started. This
value may be overridden by the
OmniPlus environment variable
ENV_RUN-TIME and related

Page 15 Of 92
Controlled copy Omniscripting Induction Manual
environment variables.  This field is in
HHMMSS format

Use OcTime_Current() to retrieve the


actual CPU Time
SD005 SDProcDt Current Processing Date. The date of System N08
the currently processing transaction, or
supplied via a TI002 Date card. This field
is in CCYYMMDD format.
SD006 SDNumFCs Total Number of Fund Control Records System N03
for the current plan
SD007 SDNumPFs Number of Participant Fund Records for System N03
the current participant
SD008 SDPartCtr Total Participants processed in this pass System N09
(Unified)
SD009 SDActive RGEN Status Flag.  Values are: System X01
0 – Active
1 – Inactive
Note: Not in Use.
SD010 SDEdit Edit Mode Indicator.  This value System or User X01
corresponds with the OmniPlus
environment variable ENV_GLOBAL-
MODE. Values are:
0 or “E” – Edit mode
1 or “P” – Update mode
This field may be updated by the
OmniScript text only in the online
environment.
SD011 SDTSeq Current Transaction Pass-Sequence System X01
SD012 SDNumICs Total Number of Investment Control System N03
Records
SD013 SDTotPage Total Page Flag (T966).  Values are: System N01
0 – Not a totals page
1 – Totals page
SD014 SDFMRpt File Maintenance Reporting Option. User N01
Values are:

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

Field Literal Alias Field Description Valued By: Format


SD017   Display Log Messages Flag.  Allows User X01
users to specify where LOG messages
should be routed, either to OP-02 reports
(Information Log, Warning Log, Reject
Log), to SYSOUT logs, or both.
“Y” – Route log messages to SYSOUT
(default for Jobcalc)
“ “ – Route log messages to OP-02
reports (default for Unified Jobs)
“B” – Route log messages to both
SYSOUT and OP-02 reports.
SD020 SDFmt1 RS02 Message Field Mask-1.  Indicates User X01
the print format for numeric values in
OmniScript messages.  Values are:
0 – Dollar S9(9)V99 format
1 – Share S9(9)V9(4) format
2 – Whole number S9(9) format
3 – Price S9(7)V9(6) format
4 – Date S9(6) format
5 – Time S9(4) format
6 – Percent S9(3)V9(4) format
7 – Social security number S9(9) format
8 – Count S9(9) format
See Also: Output Report Message
Facility
SD021 SDFmt2 RS02 Message Field Mask -2.  Values User X01
are same as SD020.
SD022 TranType Transaction Type.  Refers to the TYPE System X02
field on a Participant Inter-Fund Transfer
(T381) transaction or the TYPE field on a

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.

Field Literal Alias Field Description Valued By: Format


SD040 SDYYMMDD Date Conversion Field-1.  Used for System or user. N08

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

Field Literal Alias Field Description Valued By: Format


SD057 SDCompiler COBOL Compiler used to compile System X08
OmniPlus.
COB2 – MVS COBOL
MFC – Micro Focus COBOL
FUJ – Fujitsu NetCobol
SD058   Unified Process Step (PT, PF, M1, M2, System X02
etc.)
SD059   Job Identifier System X20
SD060   Text String 1 - Text Work Area.  Stores User X200

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

Field Literal Alias Field Description Valued By: Format


SD080 SDLoopMax MAX-LOOP-COUNTER.  Overrides for  User N09
maximum number of times a LOOP will
execute.  Default is 500.  The maximum
value is 999,999,999.
SD085   Override date for loan balances.   User N06D00
Overrides the processing date when
calculating the highest outstanding loan
balance (LH991).
SD090   Trigger Event Name.  The event name System X20
associated with an OmniScript. 
(e.g., “RunStart”, “RunEnd”, “PlanStart”)
SD091   Events Enabled Flag.  Indicates that System, but may be X01
base processing events have been overridden by the user in
enabled or disabled. the OmniScript text.
   Y – Events are enabled.

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

Field Literal Alias Field Description Valued By: Format


SD106   OmniScript Return Code Reason This System X02
field is set when a OmniScript calls an
external program (i.e., user exit) or a
variable ROUTINE (i.e., PERFORM tx1).
00 – Reason OK
05 – Missing Routine
99 – Unimplemented COBOL program,
i.e., module not available
SD109   OmniScript behavior may be modified User X01
when a numeric value is directly
assigned to an alphanumeric field (e.g.
TX001 = 1234.56)
‘ ‘ – Default, return the value in a
readable format, displaying all digits,
without leading zeroes, and inserting
commas where necessary, e.g.
“1,234.56”
‘L’ – Legacy behavior, return as a 1-11
digit integer, depending on the length of
the target field, e.g. “00000001234”.
Leading zeroes are used, and all
decimal positions are truncated.
‘E’ – Produce a compile error if a
numeric value is directly assigned to an
alphanumeric field.  If this value is set,
OcFmt must be used to format the
numeric field before assigning it to an
alphanumeric field.
This environment value may be used to
override OC_NTOX.
SD120   Number of memory gets done System N13
SD121   Number of memory frees done System N13
SD122   Total allocated memory.  This field System N13
maintains a running total of memory

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.

Field Literal Alias Field Description Valued By: Format


SD127   Trace Statements - Number of User N09
instructions to trace the execution of via
Sysout messages.
SD200   Current Transaction Active Flag. SD200 System, but may be X01
is the currently executing transaction overridden by the user in
active flag. It is set to 'Y' by the the OmniScript text.
transaction processor at StartTran, and
must be 'Y' after StartTran for the
transaction to continue to process.
SD200 can be set to 'N' to stop the
current transaction from further
processing. For example, setting it to 'N'
in the middle of a plan level pass will
cause the transaction to end without

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.

Field Literal Alias Field Description Valued By: Format


SD232   Skip This Plan.  Can be set to 'Y' at the User X01
PlanStart event. Skips processing this
plan.
SD901 SDCR The Carriage Return character. System X01
SD902 SDLF The Line Feed character. System X01
SD903 SDFF The Form Feed character. System X01
SD904 SDTab The Horizontal Tab character. System X01
SD905 SDEsc, The Escape character. System X01
SDEscape
SD906 SDBel, SDBell The Bell character. System X01

Work Accumulator(WA) Variables

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.

OmniScript Text Explanation of OmniScript Statement


WA003=WA003+1 Sets WA003 to increment by +1 with each participant. The initial
value of WA003 is '0'.
WK001=WA003; Sets WK001 equal to the incrementing value of WA003 so that
check numbers can be printed.

Indexed Work(IW) Variables

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.).

Required OmniScript Text


PARM SECTION.
FORM=0001
TEXT SECTION.
>L001
>L005 >PH911
>PART
MARKET SHARE
VALUE BALANCE CONTRIB DIVIDEND
Fund 1 >100:F52 >101:F03 >102:F52 >103:F52
Fund 2 >104:F52 >105:F03 >106:F52 >107:F52
Fund 3 >108:F52 >109:F03 >110:F52 >111:F52
Fund 4 >112:F52 >113:F03 >114:F52 >115:F52
CALC SECTION.
SD030 = 100;
WK001 = 1;
EACH@***;
IW000 = PF999;
IW001 = PF130;
IW002 = PF200;
IW003 = PF210 + PF220 + PF230;

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.

(WF) Work Fund Fields

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.

OmniScript Text Explanation of OmniScript Statement


EACH@***; Initializes an EACH@ statement so that amounts stored in WF fields
are by specific investment and source.
WF004=PF999; Stores the participant account value (PF999) in WF004 for each fund
WF005=PF130; and source. Stores the participant share balance (PF130) in WF005
YWF006=PF100; for each fund and source. Stores the participant un-invested cash
ENDEACH; amount (PF100) in WF006 for each fund and source.

The following program is used in conjunction with the withdrawal transaction.


*IF THE PARTICIPANT IS LESS THAN AGE 50.5, PAY ALL FUNDS
*EXCEPT SOURCE A
*WF004=PRE-DEFINED AS 'THE MAX.DOLLAR AMOUNT'
*WF005=PRE-DEFINED AS 'THE MAX.NUMBER OF SHARES'
*WF006=PRE-DEFINED AS 'THE MAX.AMOUNT OF UNINVESTED CASH'
EACH@***;
WF004=PF999;
WF005=PF130;
WF006=PF100;

Page 31 Of 92
Controlled copy Omniscripting Induction Manual
ENDEACH;
IF PH980<59.06;
EACH@**A;
WF004=0;
WF005=0;
WF006=0;
ENDEACH;
END;

(IT) Indexed Text Fields

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.

SD031=1; /* Start with the first one */


EACH@***;
IT1=FC031;
IT2=FC032;
IT3=FC034;
IT4=FC036;
SD031=+4;
ENDEACH;

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

CHAPTER 4 – Omniscript Operators

Operators are symbols / notations or expressions used in Omniscript programming to perform


any specific operation. Following are the two types of Operators,

 Arithmetic Operators
 Assignment Operators
 Comparison Operators
 Logical Operators

Arithmetic Operators

Operator Explanation Example Operator Explanation Example


= Assign WK001 = - Subtraction WK001-5;
3;
* Multiplication WK001 * ** Exponent WK001=3 ** 2;
3; (example: 3
squared)
/ Division WK001 / <<  Lesser of two WK001 = WK002 <<
2; values WK003;
+ Addition WK001 + >>  Greater of two WK001 = WK002 >>
(Numeric 1; or values WK003;
Values) or

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.

Operator Explanation Example


= Assign WK001 = 3;
* Multiplication WK001 * 3;
/ Division WK001 / 2;
+ Addition (Numeric Values) or WK001 + 1; or
Append (Alphanumeric Values) TX001 + TX002;
- Subtraction WK001-5;
** Exponent (example: 3 squared) WK001=3 ** 2;
<< Lesser of two values WK001 = WK002 <<
WK003;
>> Greater of two values WK001 = WK002 >>
WK003;
=: Assign and propagate a value into multiple WK001=WK002=:WK003;
fields

Assign & Propagate Operator (‘=:’)

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;

WK001=WK002=:(WK003=:200); Stores 200 in WK001, WK002, and WK003

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.

Operator Explanation Example


< Less than If (WK001<20);…
> Greater than If (WK001>20);…
= Equal If (WK001=20);…
 
If (TX001=’Fred’);

<= Less than or If (WK001<=20);…
equal to
>= Greater than or If (WK001>=20);…
equal to
>< Not equal to If (WK001><20);…
   
or If (WK001<>20);…
   
<> If (TX001><’Fred’);

   
  If (TX001<>’Fred’);

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.

Operator Explanation Example


AND Compares two or more operands, all of which If (WK001>20) and (WK001<40);
must be true …
OR Compares two or more operands at least one If (WK001<20) or (WK001>40);…
of which is true

Page 36 Of 92
Controlled copy Omniscripting Induction Manual

CHAPTER 5 – Omniscript Programming Stmts

Following are some of the control statements used to control the flow of program,

Type of Statement Statement Used


Conditional IF / ELSE / END
Iteration EACH@/ ENDEACH
LOOP /END LOOP
Termination QUIT
ABEND

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'

OmniScript statement Explanation

IF (PH021=0); Tests the condition 'PH021=0'. PH021 is participant


status. If the participant has a status of '0' (active), this
PH600=1;
OmniScript sets the value of PH600 (a user-defined
END;
field) to 1. If the participant status is something other
than '0', the OmniScript will ignore the participant. The
'END' statement is necessary to stop the 'IF' conditional
query.

Simple 'IF/ENDIF'

OmniScript statement Explanation

IF (PH021=0); Tests the condition 'PH021=0'. PH021 is participant


status. If the participant has a status of '0' (active), this
PH600=1;
OmniScript sets the value of PH600 (a user-defined
ENDIF;
field) to 1. If the participant status is something other
than '0', the OmniScript will ignore the participant. The
'END' or ‘ENDIF’ statement is necessary to stop the 'IF'
conditional query.

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'

OmniScript statement Explanation

IF (PH021=0); Again, tests the condition 'PH021=0'. PH021 is


participant status. If the participant has a status of '0'
PH600=1;
(active), this OmniScript sets the value of PH600 (a
ELSE;
user-defined field) to '1'. If the participant status is
PH600=2; something other than '0', this OmniScript does not

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.

Simple Nested 'IF/END'

OmniScript statement Explanation

IF (PH021=0); Tests the condition 'PH021=0'. PH021 is participant status.


If the participant has a status of '0' (active), continues to
IF (PH170>150000);
the next conditional statement 'PH170 > 150000'. PH170
PH600=1;
is salary. If the participant is active status (PH021=0) and
END; has a salary greater than $150,000 annually, this

END; OmniScript sets the value of PH600 (a user-defined field)


to '1'. If the participant status is something other than '0',
or the participant salary does not exceed $150,000, this
OmniScript ignores the participant. Both conditions must
be met before PH600 is set to a '1'. Note that two 'END'
statements are necessary to stop the two 'IF' conditional
queries.

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'

OmniScript statement Explanation

IF (PH021=0); First, tests the condition 'PH021=0'. PH021 is participant


status. If the participant has a status of '0' (active), this
PH600=1;
OmniScript sets the value of PH600 (a user-defined field)
END;
to '1'. Second, tests the condition 'PH170>150000'. If the
IF (PH170>150000); participant salary (PH170) exceeds $150,000, this

PH601=2; OmniScript sets the value of PH601 to a '2'. If the


participant status is something other than '0' this
END;
OmniScript does not set PH600. If the salary is less than
$150,000, this OmniScript does not set PH601. Note that
the two conditional tests are independent of each other.
The two 'END' statements are necessary to stop the two

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.

Complex Nested 'IF/END'

OmniScript statement Explanation

IF (PH021=0); First, tests the condition 'PH021=0'. PH021 is participant


status. If the participant has a status of '0' (active), this
PH600=1;
OmniScript sets the value of PH600 (a user-defined field)
IF (PH170>150000);
to '1'. Then, for participants who met the initial condition
PH601=2; and had PH600 set to '1', tests a second condition
END; 'PH170>150000'. If this condition is met, this OmniScript
sets PH601 to a value of '2' for participants who met both
END;
conditions. Note that for participants who did not meet the
first condition (PH021=0), the second condition is not even
considered. The two 'END' statements are necessary to
stop the two 'IF' conditional queries.

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.

Example of using the ELSEIF 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@ / ENDEACH' statements execute OmniScript statements against qualified


participant fund (PF), fund control (FC), investment control (IC), or source control (SC) records.
The type of record accessed (PF, FC, IC, or SC) is specified as a suffix on the EACH statement.
The default value is participant fund (_PF).

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.

Process participant fund records

OmniScript statement Explanation

EACH_PF@10*; Requests processing any/all PF records for investment


10. For every occurrence of participant funds (PF) for
WF001=PF200;
fund 10, any source (*), then stores the participant
ENDEACH;
contributions in work fund field WF001. Note that a work
fund field WF001 exists for each fund and source. As a
result, the 'EACH@' statement stores contributions for
as many sources as fund 10 has available, e.g., fund
10A in WF001 for 10A, fund 10D in WF001 for 10D, etc.
The 'ENDEACH' statement ends the processing loop
after PF200 has been stored for all sources of fund 10.

Process fund control records

OmniScript statement Explanation

SD031=1; The indexed text base counter (SD031) is set to '1',


indicating that IT work fields will correspond to TX work
fields plus 1 (IT000=TX001, IT001=TX002, etc.) to begin
with.

EACH_FC@***; Initializes the 'EACH@' statement for all funds and


sources.

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).

WK002=+1; Work field WK002 is being used as a counter. After each


pass through the FC records, it is incremented by one.
IF (WK002>10);
When it reaches a number greater than 10, the
ENDEXIT;
OmniScript uses an 'ENDEXIT' to stop the 'EACH@'
loop and exit the program.

SD031=+2; After each pass through the FC records, the indexed


text base counter is incremented by '2' so that on the
ENDEACH;
second pass IT000 stores the FC record information in

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).

Process investment control records

The _IC process always passes all investments.

EACH_IC@***;

...

ENDEACH;

Process source control records

The _SC process always passes all sources.

EACH_SC@***;

...

ENDEACH;

Dynamic Fund Ids

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 'LOOP / ENDEXIT / ENDLOOP' commands execute a block of statements repeatedly to


accomplish a specified task. OmniScript instructions found between the 'LOOP' and 'ENDLOOP'
iterators are executed until an 'IF/ENDEXIT' is encountered or the Max Loop Counter (SD080)
exceeds the maximum loop value set by the user (default is 500). Instructions within the loop
command must include an 'IF/ENDEXIT' conditional statement to determine if the loop process is
complete.

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'

OmniScript Text Explanation of OmniScript Statement

SD030=100; Sets the Indexed Work Field Base Value (SD030) to


100. So now IW000 will store information in WK100,
IW001 in WK101, IW002 in WK102.

WK001=1; Pre-sets WK001 to a value of '1'. This work field will be


used to store the incrementing loan numbers.

LOOP; Establishes a LOOP statement. All subsequent


commands will be repeated until the OmniScript reaches
a condition that ends the loop.

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.

IF WK001>3; Determines if the loan number is greater than 3, and if


so, ends the loop statement.
ENDEXIT;

IF LH315>0; Determines if the participant has a loan balance. LH315


is a loan header data element that contains current
balance.

Page 44 Of 92
Controlled copy Omniscripting Induction Manual
IW000=LH300; Sets IW000 to the loan number.

IW001=LH315; Sets IW001 to the loan balance.

SD030=+2; Increments the Indexed Work Field Base Value by +2 so


that now IW000 will store information in WK102, IW001
END;
in WK103 for the next loan.

WK001=+1; Increments the WK001 field that is used to identify the


loan number by +1, so that on the second pass the
OmniScript will gather information on Loan 2.

ENDLOOP; Ends the LOOP statement.

Example

Task

Sum WK fields 1 through 50 into WK100 using Indexed Work (IW) fields.

SD30 = 0; /* Initialize the IW subscript to zero */

LOOP;

WK100 =+ IW1;

SD030 =+ 1; /* Increment the IW subscript)

IF (SD30>=50);

ENDEXIT;

ENDLOOP;

Result

WK100 equals the sum of WK1 through WK50.

LOOP WHILE/UNTIL

A WHILE or UNTIL condition can be used with the loop, and is preferred over the IF/ENDEXIT
processing.

LOOP UNTIL will process until the parameter condition is true.

LOOP WHILE will process until the parameter condition is false.

WK1=0;

LOOP WHILE WK1<5;

...

Page 45 Of 92
Controlled copy Omniscripting Induction Manual
WK1=+1;

ENDLOOP;

WK1=0;

LOOP UNTIL WK1>5;

...

WK1=+1;

ENDLOOP;

Eliminates the need to code 'IF/ENDEXIT' within the loop.

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'

OmniScript statement Explanation

IF PH021=31; Examines a participant's status. If the status is '31'


(terminated), the QUIT command is executed and the
QUIT;
OmniScript goes to the next participant. If the status is
END;
not '31', the rest of the OmniScript executes to store
WK001=PF200@10*; contributions, cash, and shares in work fields.

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;

Following is the explanation of what the above piece of code is doing.

 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

CHAPTER 6 – Omniscript Business Object Functions

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.

Following are the various Omniscript business object functions,

Function Object (Record Type) Function Object (Record Type)


Name Name
AAAAOBJ Alternate Address LNLHOBJ Loans (Loan Header)
ANAMOBJ Annuity (Annuity Master) LNLPOBJ Loans (Loan Payment)
Participant (Associated
PTAIOBJ Individual) MSMSOBJ Messages
BAI2OBJ Base (Alternate Inquiry) NTNDOBJ Notes (Note Detail)
BALOOBJ Base (Log Base Text) NTNHOBJ Notes (Note Header)
BAI3OBJ Base (Alternate Inquiry 3) NTOBJ Notes (Header and Detail)
Base (User Defined Base
BAUDOBJ Text) DNBEOBJ * OmniDBEN (Beneficiary)
PLLCOBJ Plan Locator DNCROBJ * OmniDBEN (Computation Results)
PLLHOBJ Plan Locator Header DNIROBJ * OmniDBEN (Interest Rate)
BABTOBJ Base Text (Base Text) DNPBOBJ * OmniDBEN (Prior Benefit)
BAEUOBJ Base Text (Extended UDF DNPNOBJ * OmniDBEN (Participant)

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)  

Business Objects Operations

XXYYOBJ OBJECT ACCESS Functions

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

INSTANCE - Refers to a unique database physical record (e.g. PH-REC), or sometimes to a


collection of records (e.g., Participant) consisting of more than one record.

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.

Common Object Access Operations

Area Operations Description

View Oriented View Define range for accessing records

First Access the first qualified record

Next Access the next record within a VIEW

Prev Access the previous record within a VIEW*

Last Access the last qualified record*

Count Count all qualified records

RecAreaPresent Indicates a valid, current record area

Record Level Init Initialize a record

OBJID Return a record’s unique Object identifier

Get Access a specific record

GetGE Access a record >= to a specified key

GetGT Access a record > a specified key

GetLT Access a record < a specified key

Delete Delete a record

Copy Copy a record

Move Move (Copy and Delete) a record

Update Update (Change) a record

Add Add (write) a record

Page 52 Of 92
Controlled copy Omniscripting Induction Manual
Error Return an error code

ErrMsg Return an error message

RecordLabel Return the record label

RecordName Return the record name

RecordType Return record type in numeric form

Data Element Level DE Return the alphanumeric value of a DE

(DE) NumDE Return the numeric value of a DE

SetDE Set the value of a DE

DEAttribute Returns the DE Attribute

DEFmtLeng Return the length of a formatted DE

DEHtmInp Create HTML FORM input code for a DE

DELabel Return the DE label

DelsKey Returns a value to signify a key field

DEName Return a DE’s name

DENext Return the next DE number

DEPic Return the picture clause of a DE

DERDBNum Return the RDB number for a DE

DERelated Returns the related DE number

DEType Return a DE’s type

DEValDesc Return the description for a DE value

DEValKey Return the specified legal value (alphanumeric)

DEValKeyN Return the specified legal value (numeric)

DEValid Validate a DE Number or Name

DEValName Return a DE’s legal value name

DEXML Return a DE in descriptive XML format

Clipboard ToClip Copy record to the clipboard as XML or text

ToClipAdd Append record to the clipboard as XML or text

Other Validate1 Verify all fields contain legal values

Page 53 Of 92
Controlled copy Omniscripting Induction Manual
Validate2 Verify all “foreign keys” are valid

View Oriented Operations

_VIEW – Define range for accessing records

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

Key or Filter parameters, which vary by record type, are allowed.

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

[OBJID: An OBJID, must be one of this object’s ids, or a compatible object’s id


tx]

[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.

[STATU Record Dependent TEXT field to filter VIEW/NEXT fetches


S:]

Example

The PLPLOBJ library allows the following _VIEW filters:

Parameter Description

[PLAN:tx] Plan Identifier

[PLANLO:tx] Lo plan number to start with

[PLANHI:tx] Stop after processing this plan number

The PTPHOBJ library allows the following _VIEW filters:

Page 54 Of 92
Controlled copy Omniscripting Induction Manual
Parameter Description

[PLAN:tx] Plan Identifier

[PLANLO:t Lo plan number to start with


x]

[PLANHI:tx Stop after processing this plan number


]

[STATUS:t Qualifies only participants with PH-STAT indicating ‘ACTIVE’, ‘INACTIVE’ ‘SUSPENDED’, ‘RETI
x] ‘DEFERRED’, ‘TERMINATED’, and ‘INELIGIBLE’

[STATUS:’ Qualify only participants with PH-STAT = ‘30’


30’]

VIEW Parameters vary by object and may include:

§ Each key field, with a LO/HI value. (e.g. PLANLO:'000001', PLANHI:'222222')

§ Filter criteria for various key or data fields. (e.g. STATUS:'31' or FUNDFILT:'1**' or
RUNDATELO:19980101)

_FIRST – Access the first qualified record

Specify access filters and get first occurrence

Parameters

Key or Filter parameters, which vary by record type, are allowed.

Returns

1 (True) if a record was found

0 (False) otherwise

Example

PTPHOBJ_FIRST(PLAN:'777777');

* Returns the first PH record occurrence in plan '777777'

_NEXT – Access the next qualified record within a VIEW

Return next instance within a VIEW. A previous VIEW operation is required.

Parameters

None

Page 55 Of 92
Controlled copy Omniscripting Induction Manual
Returns

1 (True) if a instance is available, 0 (False) Error or End of File

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');

LOOP WHILE PTPHOBJ_NEXT();

OCSHOW(PTPHOBJ_DE("NAME"));

ENDLOOP;

_PREV – Access the previous qualified record within a VIEW

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

1 (True) if a instance is available, 0 (False) Error or Beginning of File

After a successful _PREV, there is a current record with which to perform record or data element
operations.

Example

PTPHOBJ_VIEW(PLAN:'777777');

LOOP WHILE PTPHOBJ_PREV();

OCSHOW(PTPHOBJ_DE("NAME"));

ENDLOOP;

Page 56 Of 92
Controlled copy Omniscripting Induction Manual
_LAST – Access the last qualified record

Specify access filters and get last occurrence.

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.

Note: The LAST operation is not available on the MVS platform.

Parameters

Key or Filter parameters, which vary by record type, are allowed.

Returns

1 (True) if a record was found

0 (False) otherwise

Example

PTPHOBJ_LAST(PLAN:'777777');

* Returns the last PH record occurrence in plan '777777'

_COUNT – Count the number of qualified records

Executes a VIEW and then NEXT functions, counting each record, returning the total number of
qualified records.

Parameters

Key or Filter parameters, which vary by record type, are allowed.

Returns

Number of Object Instances in this VIEW.

Example

WK001=PTPHOBJ_COUNT(PLAN:'777777');

* Stores the number of participants in plan '777777' in WK1

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.

_RecAreaPresent- Indicates a valid, current record area is available

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

CurrentRec and CurrentRecord

Returns

1 (True) if a record was found

0 (False) otherwise

Example

* Fetch the 2005 TALM record if it isn't already available.

If TALMOBJ_RecAreaPresent()=False;

If TALMOBJ_NumDE(015) <> 2005;

TALMOBJ_Get(Year:2005);

End;

End;

Record Level Operations

_INIT – Initialize a record

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

Key parameters, which vary by record type, are allowed.

Example

PTVROBJ_INIT(PLAN:'777777' PARTID:PH007);

PTVROBJ_SETDE(DENUM:100 VALUE:'5789');

PTVROBJ_SETDE(DENUM:105 VALUE:4);

PTVROBJ_ADD();

_OBJID – Return a record’s unique object identifier

Return a text field with the object identifier

Page 58 Of 92
Controlled copy Omniscripting Induction Manual
Parameters

None

Returns

A text field with the object identifier

Example

PTPHOBJ_VIEW(PLAN:SD001);

PTPHOBJ_NEXT();

TX001=PTPHOBJ_OBJID();

* RETURNS: 'OBJID:PTPH PLAN:111111 PARTID:000000001'

_GET – Access a specific record

Get using specified key fields or OBJID

Parameters

Key parameters, which vary by record type, are allowed.

Returns

1 (True) if record was found, 0 (False) otherwise

Example

PTPHOBJ_GET(PLAN:'111111' PARTID:'222222222');

_GETGE – Access a record greater than or equal to the specified key

Get greater than or equal to (>=) using specified Key fields or OBJID

Parameters

Key or Filter parameters, which vary by record type, are allowed.

Example

PTPHOBJ_GETGE(PLAN:'777777' PARTID'000000001');

TX001=PTPHOBJ_OBJID();

Note: Key information can be specific (e.g. PLAN:'111111' PARTID:'222222222')

or an ObjectID (e.g. OBJID:TX1)

or generic (e.g. PLAN:'111111'')

_GETGT – Access a record greater than to the specified key

Get greater than (>) using specified Key fields or OBJID

Page 59 Of 92
Controlled copy Omniscripting Induction Manual
Parameters

Key or Filter parameters, which vary by record type, are allowed.

_GETLT – Access a record less than the specified key

Get less than (<) using specified Key fields or OBJID

Parameters

Key or Filter parameters, which vary by record type, are allowed.

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.

_DELETE – Delete the specified or current record

Delete specified Occurrence

Parameters

Key parameters, which vary by record type, are allowed.

If key information is given, delete the specified instance.

If no parameters are given, delete the current instance

Returns

1 (True) if an instance is deleted, 0 (False) if no delete occurred due to Error/End of File

Example

IF DSDSOBJ_GET(PLAN:'777777' DIVSUB:'1234');

DSDSOBJ_DELETE();

TX001='REC DELETED';

ELSE;

TX001='DELETE FAILED';

END;

_COPY – Copy the current record

Copy specified occurrence, using given Key fields. Makes a copy of the current record, and writes
it using the given new Key fields.

Parameters

Key parameters for the new record.

Page 60 Of 92
Controlled copy Omniscripting Induction Manual
Returns

1 (True) if an instance is copied, 0 (False) if no COPY occurred due to Error

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');

TX001='PH RECORD COPIED';

ELSE;

TX001='COPY FAILED';

END;

_MOVE – Move the current record

Delete specified occurrence and copy to given Key

Parameters

Key parameters for the new record

Returns

1 (True) if an instance is moved, 0 (False) if no MOVE occurred due to Error

Example

IF PTPHOBJ_GET(PLAN:'777777' PARTID:'444000000');

PTPHOBJ_MOVE(PLAN:'777780');

TX001='PH RECORD MOVED';

ELSE;

TX001='MOVE FAILED';

END;

_UPDATE – Update (Change) the current record

Rewrite current occurrence.

Parameters

None

Page 61 Of 92
Controlled copy Omniscripting Induction Manual
Returns

1 (True) if an instance is copied, 0 (False) if failed occurred due to Error

Example

DSDSOBJ_VIEW(PLAN:'777780');

LOOP WHILE DSDSOBJ_NEXT();

DSDSOBJ_SETDE(DENUM:200 VALUE:1);

DSDSOBJ_UPDATE();

ENDLOOP;

Note: This function cannot be used to change the Key fields of a record.

_ADD – Add the current record

ADD the current occurrence to the database

Parameters

None

Returns

1 (True) if add was successful, 0 (False) otherwise

Example

* ADD PIN NUMBER

PTVROBJ_INIT(PLAN:SD001 PARTID:PH007);

PTVROBJ_SETDE(DENUM:100 VALUE:'5789');

PTVROBJ_SETDE(DENUM:105 VALUE:4);

PTVROBJ_ADD();

_ERROR – Return the error status of the previous IO operation

Parameters

None

Returns

1 (True) if the last IO operation terminated in error, 0 (False) if the last IO operation was
successful

Example

PLPLOBJ_GET(PLAN:'111111'); /* Attempt to read this record */

Page 62 Of 92
Controlled copy Omniscripting Induction Manual
WK001=PLPLOBJ_ERROR(); /* WK001 might be 0 indicating success, or 1 indicating no such
record */

_ERRMSG – Return the error message of the previous IO operation

Return code and message of previous IO operation

Parameters

None

Returns

A TEXT message containing the File Status and a description of the last IO completion FILE-
STATUS

Example

PLPLOBJ_GET(PLAN:'111111'); /* Attempt to read this record */

TX001=PLPLOBJ_ERRMSG(); /* TX001 might be '00 - Successful' or '23 - Record not Found' */

_RecordLabel – Return the record label

Returns the label for the object record.

Parameters

None

Returns

The label for the record being requested.

Example

TX003=AAAAOBJ_RECORDLABEL(); /* Show the record label value */

Returns: 'AltAddr'

_RecordName – Return the record name

Returns the name for the object record.

Parameters

None

Returns

The name for the record being requested.

Example

TX002=PTPHOBJ_RECORDNAME(); /* Show the record label value */

Page 63 Of 92
Controlled copy Omniscripting Induction Manual
Returns: 'Participant Header'

_RecordType – Return the numeric value for record type

Returns a numeric value to represent the record type.

Parameters

None

Returns

1 (Record), 2 (Transaction), 3 (Trailer), 4 (Control)

Example

TX002=PTPHOBJ_RECORDNAME(); /* Show the record label value */

Returns: 'Participant Header'

Data Element Level Operations

Once a record is current, either by reading it or by initializing an empty instance, the DE


operations can retrieve or set values. Data Elements may be accessed by Data Element Number
or Name.

_DE – Return the text value of a data element

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

Either of the following:

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

Text value of the Data Element

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');

_NUMDE – Return the numeric value of a data element

Fetch Numeric value of Data Element

Parameters

Either of the following:

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

The value of the specified Data Element

Example

PTPHOBJ_VIEW(PLAN:'777777');

PTPHOBJ_NEXT();

TX001=PTPHOBJ_NUMDE('SALARY');

/* OR */

TX001=PTPHOBJ_NUMDE(170);

_SETDE – Set the value of a data element

Sets the specified value of the specified Data Element

Parameters

Either of the following:

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

[VALUE:]tx or num The value to set the element to

Page 66 Of 92
Controlled copy Omniscripting Induction Manual
Returns

1 (DE stored), 0 (Invalid field or value)

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');

_DEAttribute – Returns the DE Attribute

Returns the special attribute of the specified Data Element

Parameters

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

_DEFMTLENG – Get the formatted length of a data element

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

[DENUM:]num The 3 digit numeric data element number of the element

[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 characters in the actual formatted length of the element.

Example

* Show all legal values and descriptions for PH170 (salary)

WK001=PTPHOBJ_DEFMTVAL(170);

_DEHTMINP – Create HTML FORM input code for a DE

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

Either of the following:

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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);

/*

clipboard contents may contain the following, for example:

<select name="PTPH030">

<option select="1">Male</option>

<option select="2">Female</option>

</select>

*/

TX001 = PTPHOBJ_DeHtmInp(011);

/*

clipboard contents may contain the following, for example:

<input type="text" name="PTPH011" size="30" maxlength="30" value="PARTICIPANT, SAMPLE


" />

Page 69 Of 92
Controlled copy Omniscripting Induction Manual
*/

_DELabel – Returns the DE Label

Returns the label value of a data element.

Parameters

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

_DElsKey – Returns a value if a key field

Returns a value if the field is a key field.

Parameters

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

1 (Key field), 0 (Not a key field)

TX005=FNFCOBJ_DEISKEY(026);

_DENAME – Return the name of a Data Element

Parameters

Either of the following:

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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_DENAME(DENUM:'021'); /* Returns: ‘STAT’ */

_DENEXT – Return the next valid data element number

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

Either of the following:

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

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

0 – no more data elements exist

Example

WK001= PTPHOBJ_DENEXT(0);

LOOP WHILE WK001>0;

/* Code to process each Data Element goes here */

WK001=PTPHOBJ_DENEXT(WK1);

ENDLOOP;

_DEPIC – Return the OmniPlus DE Picture of a DE

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

[DENUM:]num The 3 digit numeric data element number of the element

[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

The text of the Internal OmniPlus picture of the element

Example

TX001=PTPHOBJ_DEPIC(170); /* Returns: ‘N11D02’ */

_DERDBNum – Returns the RDB number

Returns the relational data base number of a specified data element.

Parameters

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

_DERelated – Returns the Related DE number

Returns the DE number that the defined DE is a part of (redefined and part of de’s).

Parameters

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

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

_DETYPE – Return the type of a specified data element

Return the type of the specified Data Element (‘X’ or ‘N’)

Parameters

Either of the following:

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

Ø ‘X’ if the given element is a TEXT element

Ø ‘N’ if it is a NUMERIC element.

Ø Spaces if no such element exists

Page 74 Of 92
Controlled copy Omniscripting Induction Manual
Example

TX001=PTPHOBJ_DETYPE(007);

* Returns: 'X'

/* OR */

TX001=PTPHOBJ_DETYPE(DENUM:170);

* Returns: 'N'

_DeValDesc – Return the description of a DE Value

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

Either of the following

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

INDEX:num The selected subscript of the value, starting at 1

Returns

The text value of the selected value description, or ‘’ if no such value.

SD101 will be set to the description of the selected value.

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);

_DeValid – Determine if a Data Element exists

Return 1 (True) if the parameter Data Element exists

Parameters

Either of the following:

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

1 (True) if the parameter DE exists, 0 (no such DE)

_DeValKey – Get the specified legal value

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

Either of the following

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

INDEX:num The selected subscript of the value, starting at 1

Returns

The text value of the selected element, or ‘’ if no such value.

SD101 will be set to the description of the selected value.

Example

* Show all legal values and descriptions for PH023

WK001=1;

LOOP;

TX001=PTPHOBJ_DEVALKEY(023 INDEX:WK001);

IF SD101 =''; ENDEXIT;

OCSHOW(TX001 SD101 WK001);

WK001=+1;

ENDLOOP;

_DeValKeyN – Get the numeric value of DeValKey

Refer to the DeValKey operation. Returns the numeric value of a data element’s legal value.

Example

WK001=PTPHOBJ_DEVALKEYN(023 INDEX:WK001);

_DeValName – Return the name a data elements value

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

Either of the following:

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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');

Returns: 'Active and Eligible'

_DEXML – Format a Data Element’s Values

Return a text line describing the indicated data element

General Parameter

Parameter Description

[DENUM:]num The 3 digit numeric data element number of the element

[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

[FMT:txt] The selected format type.

‘XML2’ – XML, with a <Tag> value </Tag> format (default)

‘XML’ – Basic XML

‘PRINT’ – Data Element=’Value’ format

[TAG:tx] Select the per-element XML tag.

‘DE’ – The tag will be ‘<de>’

‘DENUM’ – The tag will be <de###> where ### is the De Number.

‘LABEL’ – The tag will be a generated DE name. (e.g. <PLANNUM>.

[ATTRIBS:TX] Identifies which Data Element fields are to be included as XML


attributes.

One or more items may be specified.

‘#’ – DE Lumber (num=”005”)

‘L’ – DE Label

‘N’ – DE Name (name=”PLANNUM”)

‘P’ – DE Picture (pic=”X06”)

‘V’ – DE Value (value=“000001”)

‘D’ – DE Value Description (desc=“Retired”)

‘*’ – All the above

The default is no attributes.

Example: ATTRIBS:’#N’

[NODES:TX] Identifies which Data Element fields are to be included as XML


nodes.

One or more items may be specified.

‘#’ – DE number (<num>005</num>)

Page 79 Of 92
Controlled copy Omniscripting Induction Manual
‘L’ – DE Label

‘N’ – DE Name (<name>PLANNUM)</name>

‘P’ – DE Picture <pic>X06)</pic>

‘V’ – DE Value (<value>000001</value>

‘D’ – DE Value Description (<desc>Retired</desc>)

‘*’ – All the above

The default is no nodes.

Example: NODES:’#ND’

Returns

The text values associated with the selected element

‘’ if no data element exists (SD101 will contain the error reason)

Examples

OmniScript Text: Returns:

PTPHOBJ_DEXML(050); <DE050> 1970/07/01 </DE050>

PTPHOBJ_DEXML(050 TAG:'LABEL'); <BrthDate> 1970/07/01 </BrthDate>

PTPHOBJ_DEXML(050 FMT:'XML2' <DE> <num> 050 </num><value> 1970/07/01 </value>


TAG:'DE' NODES:'#V'); </DE>

PTPHOBJ_DEXML(050 FMT:'XML2' <DE num="050" label="BrthDate"> 1970/07/01 </DE>


ATTRIBS:'#L');

PTPHOBJ_DEXML(050 FMT:'XML2' <DE> <num> 050 </num><value> 1970/07/01


NODES:'#LV'); </value><label> BrthDate </label> </DE>

PTPHOBJ_DEXML(050 FMT:'XML' <BrthDate num="050" value="1970/07/01"/>


ATTRIBS:'#V' TAG:'LABEL');

PTPHOBJ_DEXML(050 FMT:'XML2' <BrthDate num="050"> 1970/07/01 </BrthDate>


ATTRIBS:'#' TAG:'LABEL');

PTPHOBJ_DEXML(050 FMT:'PRINT'); DE050=1970/07/01

Page 80 Of 92
Controlled copy Omniscripting Induction Manual
Clipboard Operations

Refer to OCCLIP documentation for more information on the OmniScript Clipboard Facility.

_TOCLIP – Copy the current record to the clipboard

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

[VALUED:num] Selects only valued elements, or all elements

0 – Only valued (non zero/blank) elements

1 – All elements

[NODEID:txt] Create an XML node for this record’s data.

For example, if NODEID:’MyRec’ was specified, the XML text would contain

<MyRec>

… generated XML for each data element …

</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

PTPHOBJ_TOCLIP(NODEID:'PARTICIPANT' TAG:'LABEL' VALUED:0);

OCSHOW_FROMCLIP(); /* or */ OCFILE1_FROMCLIP();

Might returns the following text to the clipboard

<PARTICIPANT>

<PlanNum> 123456 </PlanNum>

<PartId> 123456789 </PartId>

Page 81 Of 92
Controlled copy Omniscripting Induction Manual
<PartNumX> 123456789 </PartNumX>

<Name> PARTICIPANT, TEST </Name>

<Stat> 00 </Stat>

--------- ADDITIONAL DATA ELEMENTS -----------------------

</PARTICIPANT>

_TOCLIPADD – Append the current record to the clipboard

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

_VALIDATE1 – Verify all fields are valid

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

0 (Invalid Record), 1 (Valid Record)

Note: If invalid, SD100 will contain the DE number found to be invalid, and SD101 will contain a
reason message.

_VALIDATE2 – Verify all ‘foreign keys’ are valid

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

0 (Invalid Record), 1 (Valid Record)

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

CHAPTER 7 – Omniscript Utility Functions

Omniscript Utility functions are tailor-made functions which aids in performing text, numeric
manipulations and other calculations.

Following are the Omniscript Utility Functions,

Function Name Description Object Guide

BARUN Establish OmniPlus Processing Environment OmniScript

DDRESP Generate OmniStation Packet Response OmniScript

OC966U Trial-Compile Report Writer Function OmniScript

Page 83 Of 92
Controlled copy Omniscripting Induction Manual
OCCLEAR Initialize OmniScript Field Values OmniScript

OCCLIP Clipboard Facility OmniScript

OCCNTL Parameter Control File Facility OmniScript

OCCSV Interface with Comma Separated Values (.CSV) formatted data OmniScript

OCDATA Data Container Facility OmniScript

OCDATE Date Utility OmniScript

OCEVAL Examine a field against a set of conditions/values OmniScript

OCFACT Financial Factor / Allocation Library OmniScript

OCFILB External File Read and Write Access (Byte Stream Files) OmniScript

OCFILE External File Read and Write Access OmniScript

OCFILV External File Read and Write Access (Wide Files) OmniScript

OCFIND Find (Lookup) Item Among Given Parameters OmniScript

OCFMT Format Numeric Fields into Text with Given Picture OmniScript

OCFUNC OmniScript Function Execution Facility OmniScript

OCLABEL User Defined Label Utility OmniScript

OCLABVAL Compare tables of labels and values OmniScript

OCLINE Produce OP50 Report Line Output OmniScript

OCNUM Arithmetic and Numeric Library OmniScript

OCPAGE Produce T966 Report Output Directly from OmniScript OmniScript

OCPARMS Retrieve Parameters from T588/T988 transaction entry OmniScript

OCPRAM OmniScript Parameter Processing Facility OmniScript

OCSCREEN Interactive Screen Facility OmniScript

Page 84 Of 92
Controlled copy Omniscripting Induction Manual
OCSCRIPT OmniScript Execution Facility OmniScript

OCSEL Select Item from Parameter List OmniScript

OCSHOW 'Exhibit Named' Type Display of Variables OmniScript

OCSPLIT Text Parsing Utility OmniScript

OCSUB Perform Text Sub-string Operations OmniScript

OCTEST Self Checking Canned Test Data Support OmniScript

OCTEXT Text Field Utility OmniScript

OCTIME Perform Various Time Related Operations OmniScript

OCTX TX Field Array Utility Library OmniScript

OCVALUE Iterate Numeric Values for the Loop While OmniScript

OCWK WK Field Array Utility Library OmniScript

OCWORD Convert Numeric Values Into Word Equivalents OmniScript

OCXML XML (eXtended Markup Language) Parsing Facility OmniScript

UTFSYS File System Object Facility OmniScript

UTINDX1 External Indexed File Read and Write Access OmniScript

CHAPTER 8 – Omniscript Examples

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;

SSN-BR Record Financial Extract Scan


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:TX050);/*Area to read record into*/
TX001=OCSUB(TX050 1 6);/*return a selected segment of a text string in this case
plan#*/
PTPHOBJ_VIEW(PLAN:TX001);
LOOP WHILE PTPHOBJ_NEXT();
TX011=PTPHOBJ_DE(007);
HIBROBJ_VIEW(PLAN:TX001 PARTID:TX011);
LOOP WHILE HIBROBJ_NEXT();
TX003=HIBROBJ_DE(100);/*FUND ID*/
TX004=HIBROBJ_DE(101);/*Transaction Code*/
TX005=HIBROBJ_DE(102);/*Activity*/
TX012=HIBROBJ_DE(110);/*Amount*/
TX007=HIBROBJ_DE(121);/*Shares*/
WK008=HIBROBJ_DE(008);/*Trade Date*/
TX008=OCFMT(WK008 'DATE4');
WK009=HIBROBJ_DE(009);/*Run Date*/
TX009=OCFMT(WK009 'DATE4');
TX010=HIBROBJ_DE(008);/*Run Time*/

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;

******* script to update Participant Gender ***********


SD080=99999999;
IF OCFILE1_OPEN(NAME:'$FILE1' MODE:'INPUT')=0; /* OPEN INPUT FILE
*/
DISPLAY 'OPEN FAILED INPUT FILE OCFILE1';
ABEND;
ENDIF;
LOOP WHILE OCFILE1_READ(INTO:TX110);/*Area to read record into*/
TX001=OCSUB(TX110 1 6);/*return a selected segment of a text string,PLAN#*/
TX002=OCSUB(TX110 8 9);/* SSN*/
TX003=OCSUB(TX110 18 1);/*Gender*/
WK001=OCNUM_VALUE(TX003);
PTPHOBJ_GET(PLAN:TX001 PARTID:TX002);
PTPHOBJ_SETDE(DENUM:030 VALUE:WK001);
PTPHOBJ_UPDATE();
ENDLOOP;

Page 92 Of 92

You might also like