Program Painter and Specification Editor keyword (see Keywords:)
IDMS DB target
Code native IDMS calls in the Data and Environment Divisions and pass them through, without translation, to the precompile process.
Data Division:
-KYWD- 12-*----20---*----30---*----40---*----50---*----60
IDCS IDMSControlSectionstatements
.
.
.
Environment Division:
-KYWD- 12-*----20---*----30---*----40---*----50---*----60
IDSS SchemaSectionstatements
.
.
Database call (see Database Calls)
IDMS DB target
Write a COMT checkpoint to the IDMS journal file to designate the start or end of specific database accessing activities associated with the issuing run unit and release all record locks except select locks held on current records.
IDM-COMMIT [ALL]
|
ALL |
Write a COMT checkpoint to the IDMS journal file; release all record locks held on current records; set all currencies to null.
IDM-COMMIT ALL
Database call (see Database Calls)
IDMS DB target
Connect the named record to the named set.
IDM-CONNECT REC [recordname] TO setname
Connect record type ORDER to CUSTOMER-ORDER. Note that owner record is current of record type.
MOVE SCR-ORDER-NUM TO ORDERNUM
MOVE SCR-QTY-ORD TO ORDER-QTY
DB-STORE REC ORDER
IF OK-ON-REC
MOVE SCR-ORDER-NUM TO ORDER-NUM
MOVE SCR-QTY-ORD TO ORDER-QTY
DB-OBTAIN REC CUSTOMER WHERE CUST-NUMBER = WS-CUST-KEY
IF OK-ON-REC
IDM-CONNECT REC ORDER TO CUSTOMER-ORDER
IF AB-ON-REC
PERFORM 950-ERROR-RTN Database call (see Database Calls)
IDMS DB target
Disconnect the record from the set in which it participates as an optional member.
IDM-DISCONNECT REC [recordname] FROM setname
Recordname is optional because the record is previously located by a DB-OBTAIN REF.
Disconnect record type ORDER from CUSTOMER-ORDER.
DB-OBTAIN REF CUSTOMER REC ORDER
IF OK-ON-REC
IDM-DISCONNECT REC ORDER FROM CUSTOMER-ORDER
IF AB-ON-REC
PERFORM 950-ERROR-RTN Database call (see Database Calls)
IDMS DB target
Determine if a data set is empty or if a record is a member of a given set; perform logic if condition is met.
IDM-IF SET setname [EMPTY|NOT EMPTY] ... [MEMBER|NOT MEMBER] paragraphname
IDM-IF SET DEPT-EMPLOYEE MEMBER 2000-GET-OWNER
IDM-IF SET DEPT-EMPLOYEE NOT MEMBER ... 2100-NO-OWNER
IDM-IF SET DEPT-EMPLOYEE NOT EMPTY ... 3100-GET-EMPS
Database call (see Database Calls)
IDMS DB target
Specify the program execution mode and the location of IDMS record descriptions.
-KYWD- 12--*--20---*----30----*---40---*----50---*----60 SYEN IDM-PROTOCOL programmode location
|
programmode |
Execution mode. Refer to the IDMS COBOL Programmer's Guide for valid program modes. |
||||||
|
location |
Place IDMS record descriptions copied from the IDMS Dictionary in this program area. Valid values are:
|
Set the protocol for an IDMS CICS program; place IDMS record descriptions in Working-Storage.
IDM-PROTOCOL CICS-EXEC-AUTO W-S
Database call (see Database Calls)
IDMS DB target
Return the database key and symbolic key (optional) from an indexed set via a currency or key value.
IDM-RETURN dataname FROM indexsetname ... [CURRENCY [FIRST|LAST|NEXT|PRIOR]] ... [USING keyfield] ... [KEY INTO keyfield]
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME ... CURRENCY
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME ... FIRST CURRENCY
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME ... USING WS-EMP-KEY
IDM-RETURN WS-SAVE-DBKEY FROM IX-EMP-NAME ... FIRST CURRENCY KEY INTO WS-EMP-KEY
Database call (see Database Calls)
IDMS DB target
Write an ABRT checkpoint to the IDMS journal file to recover the recovery unit (the part of the run unit falling between two checkpoints); allow the run unit to continue accessing the database without issuing the DB-BIND and DB-OPEN calls.
IDM-ROLLBACK [CONTINUE]
|
CONTINUE |
IDMS statement
IDMS DB target
Code native IDMS calls in the Procedure Division and pass them through, without translation, to the precompile process.
-KYWD- 12-*----20---*----30---*----40---*----50---*----60
IDCS IDMS nativecall
.
.
-KYWD- 12--*--20---*----30----*---40---*----50---*----60
IDMS OBTAIN FIRST CUST-REC
... WITHIN CUST-REGION
Generated rule:
$IDMS ("OBTAIN FIRST CUST-REC",
% ... "WITHIN CUST-REGION") IDMS DB target
-LINE- -KYWD- 12--*--20---*----30----*---40---*----50---*---60 000100 SYM1 % SET NOBLANK 000200 &07*NO-ACTIVITY-LOG 000300 &07*DMLIST 000800 PROC 001000 DB-OPEN MODE UPDATE 001100 DB-OBTAIN REC CUSTOMER FIRST AREA CUSTOMER-REGION 001300 IF OK-ON-REC /* APS IDMS 1.7 FLAG 001400 DISPLAY 'FIRST CUSTOMER IS ' CUST-NAME 001500 REPEAT 001600 DB-OBTAIN REC CUSTOMER 001601 ... NEXT AREA CUSTOMER-REGION 001700 UNTIL NOT OK-ON-REC 001701 DISPLAY 'NEXT CUSTOMER IS ' CUST-NAME 001710 IF END-ON-REC 001720 DISPLAY 'END OF AREA SWEEP' 001730 ELSE-IF VIO-ON-REC 001740 DISPLAY 'IDMS RULE VIOLATION ' ERROR-STATUS 001750 ELSE 001760 DISPLAY 'CATCH-ALL ERROR ' ERROR-STATUS 001770 ELSE-IF POS-ON-REC 001780 DISPLAY 'CANNOT POSITION WITHIN CUST AREA ' 001781 ... ERROR-STATUS 001790 ELSE-IF VIO-ON-REC 001791 DISPLAY 'IDMS RULE VIOLATION OCCURRED ' 001792 ... ERROR-STATUS 001793 ELSE 001794 DISPLAY 'CATCH-ALL ERROR ' ERROR-STATUS 001800 DB-CLOSE
Program Painter code:
-KYWD- 12--*---20---*----30----*---40---*---50---*---60---*
IDCS
PROTOCOL. MODE IS BATCH DEBUG
IDMS-RECORDS IN WORKING-STORAGE SECTION
IDSS DB SAMPSS WITHIN SAMPSCH.
OPT PROG
NTRY
PARA MAIN-PARA.
COPY IDMS SUBSCHEMA-BINDS
IDMS READY USAGE-MODEL IS RETRIEVAL
TP-PERFORM IDMS-STATUS
TP-PERFORM PROCESS-CUSTOMERS
IDMS FINISH
PARA PROCESS-CUSTOMERS.
IDMS OBTAIN FIRST CUST-REC WITHIN CUST-REGION
IF ERROR-STATUS GREATER THAN '0000'
TP-PERFORM ABORT-PARA
ELSE
TP-PERFORM DISPLAY-CUSTOMER
REPEAT
IDMS OBTAIN NEXT CUST-REC WITHIN CUST-REGION
UNTIL ERROR-STATUS GREATER THAN '0000'
TP-PERFORM DISPLAY-CUSTOMER
IF ERROR-STATUS = '0307'
DISPLAY '***** END OF CUST-REGION *****'
ELSE
PERFORM ABORT-PARA
PARA DISPLAY-PARA.
DISPLAY SPACE
DISPLAY 'CUST-REC = ' CUST-REC
PARA ABORT-PARA.
DISPLAY SPACE
DISPLAY '***** READ FAILURE *****'
DISPLAY 'ERROR-STATUS = ' ERROR-STATUS
IDMS FINISH
STOP RUN
Generated S-COBOL program:
% &AP-GEN-VER = 1719
% &AP-PGM-ID = "TSTIDMS"
% &AP-GEN-DB-TARGET = "VSAM"
% &AP-TP-ENTRY-KYWD-SEEN = 1
% &AP-SUBSCHEMA = ""
% &AP-APPLICATION-ID = "TSTIDMS"
% &AP-GEN-DATE = "870105"
% &AP-GEN-TIME = "15482536"
IDENTIFICATION DIVISION.
PROGRAM-ID. TSTIDMS.
AUTHOR. AP-SYSTEM GENERATED.
DATE-WRITTEN. 870105.
DATE-COMPILED. &COMPILETIME.
ENVIRONMENT DIVISION.
IDMS-CONTROL SECTION.
PROTOCOL. MODE IS BATCH DEBUG
IDMS-RECORDS WITHIN WORKING-STORAGE SECTION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. &SYSTEM.
OBJECT-COMPUTER. &SYSTEM.
DATA DIVISION.
SCHEMA SECTION.
DB SAMPSS WITHIN SAMPSCH.
WORKING-STORAGE SECTION.
$TP-WS-MARKER
$TP-COMMAREA
$TP-ENTRY ("", "")
MAIN-PARA.
COPY IDMS SUBSCHEMA-BINDS
$IDMS ("READY USAGE-MODEL IS RETRIEVAL")
$TP-PERFORM ("IDMS-STATUS")
$TP-PERFORM ("PROCESS-CUSTOMERS")
$IDMS ("FINISH")
PROCESS-CUSTOMERS.
$IDMS ("OBTAIN FIRST CUST-REC",
% ... "WITHIN CUST-REGION")
IF ERROR-STATUS GREATER THAN '0000'
$TP-PERFORM ("ABORT-PARA")
ELSE
$TP-PERFORM ("DISPLAY-CUSTOMER")
REPEAT
$IDMS ("OBTAIN NEXT CUST-REC WITHIN CUST-REGION")
UNTIL ERROR-STATUS GREATER THAN '0000'
$TP-PERFORM ("DISPLAY-CUSTOMER")
IF ERROR-STATUS = '0307'
DISPLAY '***** END OF CUST-REGION *****'
ELSE
PERFORM ABORT-PARA
DISPLAY-PARA.
DISPLAY SPACE
DISPLAY 'CUST-REC = ' CUST-REC
ABORT-PARA.
DISPLAY SPACE
DISPLAY '***** READ FAILURE *****'
DISPLAY 'ERROR-STATUS = ' ERROR-STATUS
$IDMS ("FINISH")
STOP RUN IDMS DB target
Application generation
Define processing environment for application and program generation.
| Option |
Description and Values |
||||||
|---|---|---|---|---|---|---|---|
|
Dictionary Name |
Specify the dictionary name. |
||||||
|
Central Version or Local |
Specify the compile environment. APS generates a SYSTRNL with a unique DSN whose high level qualifier is your user ID.
|
||||||
|
IDMS Local Jrnl Disk Vol |
Local compile disk volume for journal. |
||||||
|
Dictionary Update |
|
||||||
|
IDMS DMLC Output to PDS |
|
||||||
|
IDMS Loadlib Qualifier |
Specify full qualifiers for IDMS..LOADLIB. |
||||||
|
IDMS SYSCTL DSN |
Optional. Specify DSN of IDMS dictionary. |
||||||
|
CV Node Name |
Name of central version DDS (Distributed Database System) node under which loadlib program compiles. |
||||||
|
DMLIST (List Generation) |
|
||||||
|
Generate DB-BIND in Pgm |
|
||||||
|
IDMS Password |
N/A |
S-COBOL structure (see S-COBOL Structures)
Evaluate a condition.
Format 1:
IF condition1
statementblock
[ELSE-IF|ELSE IF condition2
statementblock
.
.
.
ELSE-IF|ELSE IF conditionN
statementblock ]
[ELSE
statementblock ]
Format 2:
COBOLimperativestatement
... COBOLconditionalclause
statementblock
ELSE-IF|ELSE IF condition1
statementblock
[ .
.
.
ELSE-IF|ELSE IF conditionN
statementblock ]
[ELSE
statementblock ]
ADD, RETURN, CALL, REWRITE, COMPUTE, START, DELETE, STRING, DIVIDE, SUBTRACT, MULTIPLY, UNSTRING, READ, WRITE.
If line 2020 is false, pass control back to line 1020, the first statement after the PERFORM statement, because there is no ELSE-IF or ELSE coding associated with this IF, and the first character at the same or less indentation as this IF is a new paragraph name, which denotes the end of the preceding PERFORMed paragraph. If the line 2020 condition is true, execute its subordinate statement block (lines 2030 through 2170) and return control to line 1020.
After line 2030 is executed, test line 2040. If the condition in line 2040 is true, execute lines 2050 through 2071; pass control to line 2170. If line 2040 is false, test line 2080, etc. If lines 2040, 2080, and 2120 are false, execute the ELSE statement block (line 2160) and pass control to line 2170.
-LINE- -KYWD- 12-*----20---*----30---*----40---*----50----
001010 PERFORM EMPLOYEE-BENEFIT-DEDUCTION
001020 MOVE ...
.
.
.
002010 PARA EMPLOYEE-BENEFIT-DEDUCTION
002020 IF EMPL-COVERAGE NOT = SPACES
002030 PERFORM CALC-BASIC-BEN
002040 IF EMPL-COVERAGE-TYPE = 'EXTRA'
002050 PERFORM CALC-EXTRA-BEN
002060 PERFORM CALC-DENTAL-BEN
002070 BEN-FIELD = XTRA-BEN +
002071 ... DENTAL-BEN
002080 ELSE-IF EMPL-COVERAGE-TYPE =
002081 ... 'FAMILY'
002090 PERFORM CALC-FAMILY-BEN
002100 PERFORM CALC-DENTAL-BEN
002110 BEN-FIELD = FAMILY-BEN +
002111 ... DENTAL-BEN
002120 ELSE-IF EMPL-COVERAGE-TYPE =
002121 ... 'DENTAL'
002130 PERFORM CALC-DENTAL-BEN
002140 BEN-FIELD = BASIC-BEN +
002141 ... DENTAL-BEN
002150 ELSE
002160 BEN-FIELD = BASIC-BEN
002170 EMPL-DED-FIELD =
002171 ... BEN-FIELD * .5 / 12
002180
002190 PARA CALC-BASIC-BEN
IF condition1
statementblock1
IF condition2
IF condition3
statementblock2
ELSE-IF condition4
ELSE-IF condition5
statementblock3
ELSE
statementblock4
ELSE
statementblock5
IF condition6
IF condition7
statementblock6
statementblock7
Make the MULTIPLY function conditional by ON SIZE ERROR.
-KYWD- 12-*----20---*----30---*----40---*----50---*----60
WS-NET-PAY = EMP-HOURS *
... EMP-HOURLY-RATE
... ON SIZE ERROR
PERFORM PRINT-ERROR-MESSAGE
DISPLAY SSNO WS-NET-PAY
WS-NET-PAY WS-DEDUC = 0
ELSE-IF EMP-HOURLY-RATE =
... MIN-WAGE
PERFORM CALC-DEDUC-MIN
ELSE-IF EMP-HOURLY-RATE < 5.00
PERFORM CALC-DEDUC-1
ELSE-IF EMP-HOURLY-RATE >= 5.00
PERFORM CALC-DEDUC-2
IF EMP-HOURLY-RATE > 20.00
DISPLAY SSNO
... EMP-HOURLY-RATE
ELSE
DISPLAY SSNO EMP-HOURLY-RATE
PERFORM PRINT-ERROR-MESSAGE
NET-PAY = WS-NET-PAY - WS-DEDUC
Using a NEXT SENTENCE construction, the following S-COBOL code:
-KYWD- 12-*----20---*----30---*----40---*----50---*----60
PARA CALC-BENEFIT
BEN-FIELD = ZERO
IF PERM-PART-TIME
PERFORM GROUP-A-CALC
IF HRS-WORKED > 25
BEN-FIELD =
... BEN-FIELD * 1.25
ELSE-IF PART-TIME
ELSE-IF FULL-TIME
PERFORM GROUP-B-CALC
EMPL-REC-BEN-FIELD =
... BEN-FIELD
Replaces the following COBOL code.
CALC-BENEFIT.
MOVE ZERO TO BEN-FIELD.
IF PERM-PART-TIME
PERFORM GROUP-A-CALC
IF HRS-WORKED > 25
MULTIPLY BEN-FIELD BY 1.25
ELSE
NEXT SENTENCE
ELSE
IF PART-TIME
NEXT SENTENCE
ELSE
IF FULL-TIME
PERFORM GROUP-B-CALC
ELSE
NEXT SENTENCE.
MOVE BEN-FIELD TO EMPL-REC-BEN-FIELD. IMS Fast Path DC call (see Data Communication Calls)
IMS DC target for single-platform applications
Perform Fast Path data communication calls.
$IM-CHNG altview [destination] $IM-CMD [PCBname] [msgarea] $IM-GCMD [PCBname] [msgarea] $IM-GN PCBname SSA1 [... SSA15] $IM-GU PCBname SSA1 [... SSA15] $IM-ISRT [PCBname]altview] SSA1 [... SSA15] $IM-PURG [PCBname] [msgarea] [mod]
|
altview |
Alternate view or IO PCB name. |
|
destination |
Terminal destination; can be data name or literal in an 8-byte field. |
|
msgarea |
Area where IMS returns the message segment being processed; APSAPS treats this area as the first segment of a new message. |
|
mod |
Data name or literal in an 8-byte field naming the message output description. |
|
pcbname |
Database view (maximum 20 characters); default is IO-PCB. |
|
SSA |
Segment Search Argument, which triggers COBOL MOVEs to or from the generated I/O area IM-IO-AREA; default is IM-IO-AREA with a length of 32,000 bytes. To override the length, set IM-IO-AREA-LEN in your program or the DDISYMB member. Specify only one SSA per hierarchical level along a path. These arguments generate 8-byte records in Working-Storage to hold the corresponding values. |
The following code:
$IM-CHNG ("ALT-IO", "YOUR-TERMINAL-NAME")
Generates in Working-Storage:
01 IM-DESTINATION-NAME PIC X(8).
Generates in the Procedure Division:
MOVE YOUR-TERMINAL-NAME ... TO IM-DESTINATION-NAME CALL 'CBLTDLI' USING ... IM-CHNG ALT-IO-PCB ... IM-DESTINATION-NAME MOVE ALT-IO-STATUS ... TO IM-STATUS
The following code:
$IM-CHNG ("AOT-IO", "'YOURTERM'")
Generates in Working-Storage:
01 IM-DESTINATION-NAME PIC X(8).
Generates in the Procedure Division:
MOVE 'YOURTERM' ... TO IM-DESTINATION-NAME CALL 'CBLTDLI' USING ... IM-CHNG ALT-IO-PCB ... IM-DESTINATION-NAME MOVE ALT-IO-STATUS ... TO IM-STATUS
IMS Fast Path database call (see Database Calls)
IMS DB target
Access Main Storage Data Bases (only) at the field level, and query the field contents and subsequently change the field value.
$IM-FLD MSDBview fsaname [rootssa]
|
fsaname |
COBOL dataname for the generated field search argument. See also $IM-FSA. |
|
MSDBview |
Main Storage Data Base PCB. |
|
rootssa |
Root segment search argument; if not specified, APS retrieves the first segment in the MSDB. |
Refer to your IMS documentation for more information on $IM-FLD.
IMS Fast Path database call (see Database Calls)
IMS DB target
Build your own field search argument (FSA) to use with the IM-FLD call.
$IM-FSA fsaname segment
... [field1[/picture/] operator operand1
... [field2[/picture/] operator operand2]
.
.
.
... [field10[/picture/[ operator operand10]
|
field |
Segment field name; can be 8-character IMS field name or the corresponding COBOL record name. |
||||||||||||
|
fsaname |
COBOL data name for the generated FSA; references the FSA in $IM-FLD. |
||||||||||||
|
operand |
Value to test against field in a field verify, or actual field value in a field change. |
||||||||||||
|
operator |
Valid operators for a field verify are:
|
||||||||||||
|
|
Valid operators for a field change are:
|
||||||||||||
|
picture |
COBOL picture; if not specified, APS calculates picture from field length and field type. |
||||||||||||
|
segment |
The segment referenced by the FSA; can be eight-character IMS segment name or the corresponding COBOL field name. |
Refer to your IMS documentation for more information on $IM-FSA.
IMS Fast Path database call (see Database Calls)
IMS DB target
Access Data Entry Data Bases (DEDBs) only. Retrieve the location of a specific sequential dependent segment or the last inserted sequential dependent segment, or determine the amount of unused space within each DEDB area.
$IM-POS DEDBview [SSA]
|
DEDBview |
Data Entry Data Base PCB |
|
SSA |
Segment Search Argument, which triggers COBOL MOVEs to or from the generated I/O area IM-IO-AREA; default is IM-IO-AREA with a length of 32,000 bytes. To override the length, set IM-IO-AREA-LEN in your program or DDISYMB member. Specify only one SSA per hierarchical level along a path. These arguments generate 8-byte records in Working Storage to hold the corresponding values. |
01 IM-POS-IO-AREA
05 IM-POS-LENGTH PIC S9(04) COMP.
05 IM-POS-DATA-AREA-PONAME OCCURS 240.
10 IM-POS-AREA-DDNAME PIC X(08).
10 IM-POS-INFO
15 IM-POS-CYCLS-COUNT PIC S9(8) COMP.
15 IM-POS-VSAM-RBA PIC S9(8) COMP.
10 IM-POS-UNUSED-SEQDEP-CIS PIC S9(8) COMP.
10 IM-POS-UNUSED-INDEP-CIS PIC S9(8) COMP.
APS Customizer statement (see your Customization Facility User's Guide)
Open, read, and process a user-defined rule, copybook, or other file in an APS program.
% INCLUDE ddname(filename)
|
ddname (filename) |
Ddname and file to include |
Include a rule at the top of the program.
-KYWD- 12-*----20---*----30---*----40---*----50---*----60 SYM1 % INCLUDE USERMACS(MY-RULE)
Include a rule at the bottom of the program.
-KYWD- 12-*----20---*----30---*----40---*----50---*----60 SYBT % INCLUDE USERMACS(MY-RULE)
Include a copybook in Working-Storage.
-KYWD- 12-*----20---*----30---*----40---*----50---*----60 SYWS % INCLUDE COPYLIB(MY-COPYBOOK)
Include a copybook in Linkage.
-KYWD- 12-*----20---*----30---*----40---*----50---*----60 SYLK % INCLUDE COPYLIB(MY-COPYBOOK)
Report Writer statement (see Report Writer Structures and the APS User's Guide chapter Creating Reports with Report Writer.)
Batch environments
Initialize all report counters and accumulators; set up control heading and control footing items.
INITIATE reportname1 [,reportname2] ...
Program Painter and Specification Editor keyword (see Keywords:)
Batch environments
Generate the Input-Output Section File-Control paragraph.
-KYWD- 12-*----20---*----30---*----40---*----50---*----60
IO filename ASSIGN [TO] systemname
Applicable COBOL FILE-CONTROL clauses
ISPF Dialog target
The following calls improve communication between APS/ISPF Dialog and other DC targets.
|
NTRY |
You can list explicit data areas; this allows flexibility in passing data areas between programs. |
|
TP-COMMAREA |
Not required to pass data areas between programs, but is supported for upward compatibility. |
|
SEND |
Provided for upward compatibility; does not invoke a program. Use LINK to invoke a program that displays a screen. |
|
TP-LINKAGE |
Provided for upward compatibility. This call is necessary for APS/CICS to order the LINKAGE section properly, but APS/ISPF Dialog lets you locate user records in LINKAGE without coding TP-LINKAGE. |
The PFKEY option allows PF key processing similar to APS/CICS and APS/IMS with the Program-Controlled option when converting an APS/CICS or APS/IMS application to ISPF Dialog.
Screens being converted from APS/CICS or APS/IMS must have a command field, at least 4-bytes long, for users to enter ISPF commands and to allow PF key processing to function. The command field must be. Otherwise, data truncation errors result.
Do not use the APS Prototype Execution facility to execute your ISPF Dialog programs; execute them using the Dialog Test facility provided by ISPF.
Application generation
Create job cards to submit application/program generation batch jobs.
To create up to five job cards--named J1 through J5-- with varying job names, account information, classes, and other attributes, follow these steps.
Database access clauses
SQL target
In the same call, select rows or specific columns from more than one table in the same call. Join tables together by using the DB-DECLARE, DB-OBTAIN, and DB-PROCESS calls.
With DB-DECLARE:
DB-DECLARE cursorname correlname1.copylibname-REC
... [DISTINCT]
... [column1 [... columnN]]|[NONE]
.
.
.
... correlnameN.copylibname-REC
... [column1 [... columnN]]|[NONE]
.
.
.
... [WHERE correlname.column1 oper [:]value|correlname.column2
... [AND|OR correlname.column3 oper [:]value|correlname.column4
.
.
.
... AND|OR correlname.columnN operator [:]value|correlnameN]]
... [ORDER
... column1 [ASC|DESC] [...columnN [ASC]]]
With DB-OBTAIN:
DB-OBTAIN REC correlname1.copylibname-REC
... [DISTINCT]
... [column1 [... columnN]]|[NONE]
.
.
.
... REC correlnameN.copylibname-REC
... [column1 [... columnN]]|[NONE]
... [WHERE correlname.column1 oper [:]value|correlname.column2
... [AND|OR correlname.column3 oper [:]value|correlname.column4
.
.
.
... AND|OR correlname.columnN oper [:]val|correlname.columnN]]
With DB-PROCESS:
DB-PROCESS REC correlname1.copylibname-REC
... [DB-PROCESS-ID name]
... [DISTINCT]
... [column1 [... columnN]]|[NONE]
.
.
.
... REC correlnameN.copylibname-REC
... [column1 [... columnN]]|[NONE]
... [WHERE correlname.column1 oper [:]value|correlname.column2
... [AND|OR correlname.column3 oper [:]value|correlname.column4
.
.
... AND|OR correlname.columnN oper [:]val|correlname.columnN]]
... [DB-LOOP-MAX=number]
... [ORDER
... column1 [ASC|DESC] [...columnN [ASC|DESC]]]
Controlled logic block
See the applicable database call for keyword descriptions.
Select specific columns from tables D2MASTER and D2INVTRY; add qualifications to the WHERE clause. Note that every column in the WHERE clause is preceded by a correlation name.
DB-OBTAIN REC A.D2TAB-REC ... PM_PART_NO PM_UNITS PM_COLOR ... REC B.D2INVEN-REC ... IN_PART_NO IN_QTY_ONHAND IN_DATE_LAST_ORDER ... WHERE A.PM_PART_NO = B.IN_PART_NO ... AND A.PM_COLOR = 'RED' ... AND B.IN_COLOR = 'RED'
Declare the cursor D2JOIN-CUR and include columns from tables D2MASTER and D2INVTRY. Use a WHERE clause to select rows where
Eliminate duplicate rows from the cursor set (rows with matching data in every selected column are considered duplicates). Sort the cursor set in ascending order by PM_PART_NO from table D2MASTER, then in descending order by IN_QTY_ONHAND from table D2INVTRY.
DB-DECLARE D2JOIN-CUR A.D2TAB-REC DISTINCT ... PM_PART_NO PM_COLOR B.D2INVEN-REC ... IN_PART_NO IN_QTY_ONHAND ... WHERE A.PM_PART_NO = B.IN_PART_NO AND B.IN_QTY_ONHAND > 100 ... ORDER A.PM_PART_NO B.IN_QTY_ONHAND DESC
Process the cursor D2MAST-ID. The cursor set includes columns from tables D2MASTER and D2INVTRY. Use a WHERE clause to include rows in the cursor set where:
Eliminate duplicate rows from the cursor set (rows with matching data in columns PM_PART_NO, PM_COLOR, IN_PART_NO, and IN_COLOR are considered duplicates). Sort cursor set in ascending order by D2MASTER columns PM_PART_NO and PM_COLOR.
DB-PROCESS REC A.D2TAB-REC ... DB-PROCESS-ID D2MAST-ID ... DISTINCT ... PM_PART_NO PM_COLOR ... REC B.D2INVEN-REC ... IN_PART_NO IN_COLOR ... WHERE A.PM_PART_NO = B.IN_PART_NO ... AND A.PM_PART_SHORT_DESC = ... :WS-PART-SHORT-DESC ... AND B.IN_QTY_ONHAND > 100 ... DB-LOOP-MAX=999 ... ORDER A.PM_PART_NO ASC ... A.PM_COLOR ASC
Join a table to itself. Retrieve records where the IN_QTY_ONHAND column is greater than 100 and retrieve records whose IN_DATA_LAST_ORDER column matches these records.
DB-PROCESS REC A.D2INVEN-REC ... DB-PROCESS-ID D2MAST-ID ... IN_PART_NO ....IN_QTY_ONHAND ... IN_DATE_LAST_ORDER ... REC B.D2INVEN-REC ... IN_PART_NO (:WS-PART-NO) ... IN_QTY_ONHAND (:WS-QTY-ONHAND) ... WHERE A.IN_DATA_LAST_ORDER = B.IN_DATE_LAST_ORDER ... AND A.IN_QTY_ONHAND > 100
Program Painter/Specification Editor keywords designate program Divisions and Sections. The keyword you choose determines the location of your program code within the generated program.
Program Painter keywords also designate blocks of code within which all other categories of APS structures are coded. Following any keyword, you can enter
Code keywords in the Program Painter for batch, report, or complex online programs, or in Online Express.
The following lists the keywords and their logical placement in a program.
|
Location |
Keyword |
Definition |
|---|---|---|
|
Beginning of program |
SYM1, see SY* Keywords |
Define rule variables. |
|
|
SYM2, see SY* Keywords |
Call user-defined rules after any rule libraries named in Application View. |
|
IDENTIFICATION DIVISION |
Create COBOL comments in the Comments: Section. Not valid for COBOL/2. |
|
|
ENVIRONMENT DIVISION |
Create Special-Names paragraph |
|
|
|
SYEN , see SY* Keywords |
Call user-defined rules in Special-Names paragraph. |
|
Input/Output Section |
SYIO, see SY* Keywords |
Call user-defined rules after any rule libraries. |
|
|
Code SELECT statement. |
|
|
DATA DIVISION |
SYDD, see SY* Keywords |
Call user-defined rules at the beginning of the Data Division. |
|
File Section |
SYFD, seeSY* Keywords |
Call user-defined rules after any rule libraries included. |
|
|
Code File Description or Sort Description statement. |
|
|
Record description |
Code record description in COBOL format. |
|
|
|
Specify name of data structure defined in Data Structure Painter containing record description. |
|
|
|
Specify name of data structure defined in Data Structure Painter containing record description. Structure must be coded in Data Structure Painter format (see Data Structures). |
|
|
|
++, see Joins |
Specify PANVALET member name containing record description. |
|
WORKING-STORAGE |
SYWS, see SY* Keywords |
Call user-defined rules after any rule libraries and data structures named in Application View. |
|
|
Designate Working-Storage section. |
|
|
Data definitions |
Code data structure in COBOL format. |
|
|
|
Specify name of data structure defined in Data Structure Painter containing data definition. |
|
|
|
Specify name of data structure defined in Data Structure Painter containing data definition. Structure must be coded in Data Structure Painter format (see Data Structures). |
|
|
|
++ Joins |
Specify PANVALET member name containing data definition. |
|
|
Designate DB2 table or cursor. |
|
|
|
Redefine the TP-USERAREA of the COMMAREA in CICS, IMS, and DLG parent programs. |
|
|
LINKAGE SECTION |
SYLT, see SY* Keywords |
Call user-defined rules after any rule libraries and data structures named in the Application View and preceding any SYLK code. |
|
|
SYLK, see SY* Keywords |
Call user-defined rules after any rule libraries and data structures named in the Application View. |
|
|
Designate Linkage Section. |
|
|
Data definitions |
Code data structure in COBOL format. |
|
|
|
Specify name of data structure defined in Data Structure Painter containing data definition. |
|
|
|
Specify name of data structure defined in Data Structure Painter containing data definition. Structure must be coded in Data Structure Painter format (see Data Structures). |
|
|
|
++, see Joins |
Specify PANVALET member name containing data definition. |
|
|
Designate DB2 table or cursor. |
|
|
|
Redefine the TP-USERAREA of the COMMAREA in CICS, IMS, and DLG parent programs. |
|
|
Report Section |
SYRP, see SY* Keywords |
Call user-defined rules after any rule libraries. |
|
|
Create a Report Section and specify the report name. |
|
|
|
Identify the report mock-up. |
|
|
|
Specify the type of report line, such as header, footer, detail. |
|
|
PROCEDURE DIVISION |
Designate the Procedure Division; generate program skeleton and program invocation logic. |
|
|
|
Suppress generation of program invocation logic. |
|
|
|
Designate S-COBOL or COBOL paragraph. |
|
|
|
Name the global code to be inserted. |
|
|
Declaratives Section |
Create a Declarative Section without paragraphs; code declarative statements. |
|
|
|
Create a Declarative Section paragraph; code declarative paragraph statements. |
|
|
Bottom of program |
SYBT, see SY* Keywords |
Call user-defined rules. |
|
Anywhere in the program |
/*, see Comments |
Code comments. The /* keyword does not end the action of the current keyword; the next keyword ends the current one. |
|
|
Pass associated COBOL or S-COBOL statements through the generator without translation and move the statements four columns to the left. |
The following keywords provide pass-through support by letting you code native calls and pass them through, without translation, to the precompile process.
|
IDCS and IDSS, see IDMS |
Code and pass through native IDMS DB calls. |
|
Code and pass through native SQL calls. |
|
|
CICS |
Code and pass through native CICS calls. |
The following examples include all APS keywords that you can enter in the Program Painter when creating online or batch programs. They illustrate
Online programs:
*SYM1 keyword places Customizer code here
*user rules from Appl View where Location=Top of program
*SYM2 keyword places Customizer code here
IDENTIFICATION DIVISION.
.
.
.
*/* keyword places comments here (COBOL/2)
REMARKS. REM keyword places comments here (COBOL)
ENVIRONMENT DIVISION.
.
.
.
SPECIAL-NAMES. SPNM keyword places code here
*SYEN keyword places Customizer code here
DATA DIVISION.
*SYDD keyword places Customizer code here
WORKING-STORAGE SECTION.
*user rules from Appl View where Location=Top of W-S
*data structures from from Appl View where Location=Top of W-S
*user rules from Appl View where Location=Working-Storage
*SYWS keyword places Customizer code here
*WS keyword, followed by any of the following six
* keywords that you enter on the next line
*01 keyword
*REC keyword
*DS keyword
*SQL keyword
*++ keyword
*FRFM keyword
*user rules from Appl View where Location=Bottom of W-S
*CA, CA05, CADS keywords place code here in CICS, DDS, IMS,
* DLG parent pgms
LINKAGE SECTION.
*user rules from Appl View where Location=Top of Linkage
*data structures from Appl View where Location=Linkage Section
*user rules from Appl View where Location=Linkage Section
*SYLT keyword places Customizer code here
*SYLK keyword places Customizer code here
*LK keyword, followed by any of the following six
* keywords that you enter on the next line
*01 keyword
*DS keyword
*REC keyword
*SQL keyword
*++ keyword
*FRFM keyword
*CA, CA05, CADS keywords place code here in DLG child programs
*user rules from Appl View where Location=Bottom of Linkage
PROCEDURE DIVISON. NTRY|PROC keyword generates this stmt
*OPT keyword places code here
.
.
.
*PARA keyword places code here
.
.
.
*STUB keyword places code here
.
.
.
*user rules from Appl View where Location=Bottom of program
*SYBT keyword places Customizer code here
*End of program.
Batch programs:
*SYM1 keyword places Customizer code here
*user rules from Appl View where Location=Top of program
*SYM2 keyword places Customizer code here
IDENTIFICATION DIVISION.
.
.
.
*/* keyword places comments here (COBOL/2)
REMARKS. REM keyword places comments here (COBOL)
ENVIRONMENT DIVISION.
.
.
.
SPECIAL-NAMES. SPNM keyword places code here
*SYEN keyword places Customizer code here
INPUT-OUTPUT SECTION.
*user rules from Appl View where Location=Top of I/O Section
*SYIO keyword places Customizer code here
FILE-CONTROL.
*IO keyword places code here
.
.
.
DATA DIVISION.
*SYDD keyword places Customizer code here
FILE SECTION.
*user rules from Appl View where Location=Top of File Section
*FD keyword places code here
*SD keyword places code here
WORKING-STORAGE SECTION.
*user rules from Appl View where Location=Top of W-S
*data structures from from Appl View where Location=Top of W-S
*user rules from Appl View where Location=Working-Storage
*SYWS keyword places Customizer code here
*WS keyword, followed by any of the following six
* keywords that you enter on the next line
*01 keyword
*REC keyword
*DS keyword
*SQL keyword
*++ keyword
*FRFM keyword
*user rules from Appl View where Location=Bottom of W-S
LINKAGE SECTION.
*user rules from Appl View where Location=Top of Linkage
*data structures from Appl View where Location=Linkage Section
*user rules from Appl View where Location=Linkage Section
*SYLT keyword places Customizer code here
*SYLK keyword places Customizer code here
*LK keyword, followed by any of the following six
* keywords that you enter on the next line
*01 keyword
*DS keyword
*REC keyword
*SQL keyword
*++ keyword
*FRFM keyword
*user rules from Appl View where Location=Bottom of Linkage
PROCEDURE DIVISON. /*NTRY keyword generates this stmt
PROCEDURE DIVISON USING. /*PROC keyword generates this stmt
DECLARATIVES. /* DECL keyword generates this stmt
DECLARATIVES SECTION. /* DPAR generates this stmt
*DPAR keyword places code here
END DECLARATIVES.
*OPT keyword places code here
.
.
.
*PARA keyword places code here
.
.
.
*STUB keyword places code here
.
.
.
*user rules from Appl View where Location=Bottom of program
*SYBT keyword places Customizer code here
*End of program. Copyright © 2002 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.