Micropatterns to generate branching instructions
These micropatterns generate GO TO statements in an iteration, or in a function or subfunction. The GFT and GDI micropatterns can be used to manage the iterations in a Program, Screen, or Server. The GB and GT micropatterns can be used to manage branchings to functions or subfunctions.
GFT branches to the end of the current highest iteration. GDI branches to the beginning of the current highest iteration.
The statements generated from all these micropatterns are always followed by a period.
Input format
You enter these micropatterns in the COBOL code of a Program, Screen, or Server with the PDP COBOL editor, or in the code of a Macro in the Source COBOL tab that opens with the Macro design editor.
*!GXX
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.Note: If you press CTRL + space bar in the PDP COBOL editor, the content assist facility displays the list of the micropatterns that are adapted to the entity and to the position in the COBOL code (WORKING-STORAGE SECTION or PROCEDURE DIVISION). The micropatterns that are used only to retrieve the Pacbase data are not included in the list. Each micropattern in the list is documented. If you double-click one of them, the start tag and the identifier of the micropattern are inserted in the code. You must then complete its declaration.
- GXX is the micropattern identifier: GFT or GDI.
*!GX "NN"
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.Note: If you press CTRL + space bar in the PDP COBOL editor, the content assist facility displays the list of the micropatterns that are adapted to the entity and to the position in the COBOL code (WORKING-STORAGE SECTION or PROCEDURE DIVISION). The micropatterns that are used only to retrieve the Pacbase data are not included in the list. Each micropattern in the list is documented. If you double-click one of them, the start tag and the identifier of the micropattern are inserted in the code. You must then complete its declaration.
- GX is the micropattern identifier: GF or GT.
- " " must frame the operands.
- NN is the function or subfunction level.
Generated result for GFT
MOVE ALL ‘1' TO FT GO TO F20.
- In a function < F39, GFT produces:
GO TO F39999-ITER-FT. - In a function > F39, GFT produces:
GO TO F69999-ITER-FT.
- In a check and update function (Fvunn-CHUP), GFT produces:
GO TO Fvunn-CHUP-CATR-FN. - In a selection function (Fvunn-SELC), GFT produces:
GO TO Fvunn-SELC-CATR-FN.
Generated result for GDI
GO TO F05.
- In a function < F39, GDI produces:
GO TO F39999-ITER-FI. - In a function > F39, GDI produces:
GO TO F69999-ITER-FI.
- In a check and update function (Fvunn-CHUP), GDI produces:
GO TO Fvunn-CHUP-CATR-SRVx-DONE. - In a selection function (Fvunn-SELC), GDI produces:
GO TO Fvunn-SELC-CATR-SRVx-DONE.
Generated result for GB
GO TO Fffss-900.
where ffss is
the function or subfunction whose level is indicated in the operands.Generated result for GT
GO TO Fffss-FN.
where ffss is
the function or subfunction to which the statement belongs and whose
level is indicated in the operands.Indenting the generated lines of a micropattern
You can indent the generated lines of a micropattern by entering indent=nn (where nn is a number) anywhere in the micropattern declaration line. The new indentation is effective after a new generation.
The indentation applies to the first generated line of the micropattern. The position difference, if any, with the next generated lines is kept relatively to the first newly indented line. For example, the initial indentation of the first generated line is 11. If you enter indent=20 and generate again, the new indentation of the first line becomes 20. So, the first line starts in position 21. The position of the next lines is moved to the right by 9 positions to keep the initial position difference.
- They cannot exceed column 72.
- They must start in the margin B of the COBOL code if they are in the PROCEDURE DIVISION or are generated from a WI, WE, or WS micropattern.
- The 01 and 77 levels of the lines that are generated from the WF micropattern must be in the margin A of the COBOL code.
If at least one generated line cannot be indented with the requested indentation, all the generated lines are set with the default indentation. The indent=nn indication is then ignored and the Invalid indentation value warning is displayed in the PDP COBOL editor and in the Problems view.