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 indicated in the operands.
*{OPE "DS" *}where DS is the Data Structure indicated in the Program -CD Lines tab.
OPEN USE DS-FILEwhere :
This micropattern generates the reading of the file 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, 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 indicated in the Program -CD Lines tab.
MOVE 0 TO IK READ DS-FICHIER AT END MOVE 1 TO IK
MOVE 0 TO IK READ DS-FICHIER NEXT AT END MOVE 1 TO IK
This micropattern generates the writing of the file 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, 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