These micropatterns are specific to the generation of batch Programs. They perform the opening, reading, and writing of files with a sequential, an indexed-sequential, or a dynamic organization.
The generated statements are adapted to the type of COBOL code and to the characteristics of the Data Structure call.
So for example, the same read micropattern can generate READ AT END, READ INVALID KEY, CALL GETSEQ GETRAN, or RETURN AT END.
You can indicate these micropatterns in the COBOL code of a Program with the PDP COBOL editor, or in the code of a Macro with the PDP Macro editor.
*!MP "XXXX"
where:This micropattern generates the opening of the file that is indicated in the operands.
*!OPE "DS"
where DS is
the Data Structure indicated in the Program -CD Lines tab. OPEN USE DS-FILE
where
:This micropattern generates the closing of the file that is indicated in the operands.
*!CLO "DS"
where DS is
the Data Structure indicated in the Program -CD Lines tab. OPEN DS-FILE
This micropattern generates the reading of the file that is indicated in the operands.
It uses the IK variable. This variable takes on a value other than zero when the generated statement ends abnormally (end of file or error on the key for example). You must determine the action to take, according to the value of this variable.
*!R "DS"
where DS is
the Data Structure that is indicated in the Program -CD
Lines tab. MOVE 0 TO IK
READ DS-FILE
AT END MOVE 1 TO IK
MOVE 0 TO IK
READ DS-FILE NEXT
AT END MOVE 1 TO IK
This micropattern generates the reading of the next record of the file that is indicated in the operands.
It uses the IK variable. This variable takes on a value other than zero when the generated statement ends abnormally (end of file or error on the key for example). You must determine the action to take, according to the value of this variable.
*!RN "DS"
where DS is
a Data Structure. MOVE 0 TO IK
READ DS-FILE NEXT
AT END MOVE 1 TO IK
This micropattern generates the writing of the file that is indicated in the operands.
It uses the IK variable. This variable takes on a value other than zero when the generated statement ends abnormally (end of file or error on the key for example). You must determine the action to take, according to the value of this variable.
*!W "SEGM"
where SEGM is
the Segment indicated in the Program -CD Lines tab. MOVE 0 TO IK
RELEASE SEGM
MOVE 0 TO IK
WRITE SEGM
INVALID KEY MOVE 1 TO IK
This micropattern generates the rewriting of the file that is indicated in the operands.
It uses the IK variable. This variable takes on a value other than zero when the generated statement ends abnormally (end of file or error on the key for example). You must determine the action to take, according to the value of this variable.
*!RW "SEGM"
where SEGM is
a Segment. MOVE 0 TO IK
WRITE SEGM
INVALID KEY MOVE 1 TO IK