Rational Programming Patterns

Batch micropatterns

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.

Input format

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.

You must conform to the following input format:
      *{MP "XXXX"
      *}
where :
  • *{ is the required start tag of the micropattern. The * must be entered in column 7, reserved for the comments in the COBOL code, and the { must be entered in column 8.
  • MP is the micropattern identifier (OPE, R or W).
  • " " must frame the operands.
  • xxxx are the operands of this micropattern.
  • *} is the required end tag of the micropattern. The * must be entered in column 7, reserved for the comments in the COBOL code, and the ] must be entered in column 8.

OPE micropattern

This micropattern generates the opening of the file indicated in the operands.

You must conform to the following input format:
      *{OPE "DS"
      *}
where DS is the Data Structure indicated in the Program -CD Lines tab.
This micropattern generates:
   OPEN USE DS-FILE
where :
  • USE is the use of the Data Structure in the Program (INPUT, OUTPUT, I-O or EXTEND).
  • DS is the Data Structure.

R micropattern

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.

You must conform to the following input format:
      *{R "DS"
      *}
where DS is the Data Structure indicated in the Program -CD Lines tab.
If the Data Structure access mode in the Program -CD Lines tab is S : Sequential, this micropattern generates:
   MOVE 0 TO IK
   READ DS-FICHIER
   AT END MOVE 1 TO IK
If the Data Structure access mode in the Program -CD Lines tab is D : Dynamic, this micropattern generates:
   MOVE 0 TO IK
   READ DS-FICHIER NEXT
   AT END MOVE 1 TO IK

W micropattern

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.

You must conform to the following input format:
      *{W "SEGM"
      *}
where SEGM is the Segment indicated in the Program -CD Lines tab.
If the Data Structure Input/Output mode indicated in the Program -CD Lines is T : Sort, this micropattern generates:
  MOVE 0 TO IK
	RELEASE     SEGM
If the Data Structure Input/Output mode indicated in the Program -CD Lines is not T : Sort, this micropattern generates:
  MOVE 0 TO IK
	WRITE        SEGM
  INVALID KEY MOVE 1 TO IK
Note: The third line is generated only if the Data Structure organization in the Program -CD Lines is I : Indexed.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)