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.
GB exits
the current iteration, whose level is entered in the operands. It
causes a return to the beginning of the loop. GT branches
to the end of the function or subfunction to which the statement belongs,
and whose level is indicated in the operands.
Note: If the function
or subfunction has an IT type and if it used with
an EL type function or subfunction, the GB and GT micropatterns
branch to the beginning of the EL function or subfunction.
The statements generated from all these micropatterns are always followed by a period.
Note: Other branching micropatterns can be used: GF, GFA, GD,
and GDB. However, they are specific to the Dialog
and Client/Server functions. So they are documented with the micropatterns
specific to these functions.
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.
Note: You can enter the micropatterns in full or use the wizard that is
available from the Snippets view, in the RPP snippets
category.
To indicate a micropattern
that manages the iterations, you must enter the following lines:
*!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.
- GXX is the micropattern identifier: GFT or GDI.
Note: After the instance is generated again, these micropatterns
are expanded according to the entity type and to the function into
which the micropattern is indicated.
To indicate a micropattern
that branches to a function or subfunction, you must enter the following
lines:
*!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.
- GX is the micropattern identifier: GF or GT.
- " " must frame the operands.
- NN is the function or subfunction level.
Generated result for GFT
In
a generated Program, GFT sets the end-of-file processing
switches and branches to the end-of-run function (F20):
MOVE ALL ‘1' TO FT GO TO F20.
In a generated Screen (standard or client Screen), GFT branches
to the end of the category processing.
- In a function < F39, GFT produces:
GO TO F39999-ITER-FT.
- In a function > F39, GFT produces:
GO TO F69999-ITER-FT.
In a generated Server, GFT branches to
the end of the category processing:
- 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
In
a generated Program, GDI branches to the beginning
of the iteration loop (F05) :
GO TO F05.
In a generated Screen (standard or client Screen), GDI branches
to the next occurrence of the current category, or to the next category.
- In a function < F39, GDI produces:
GO TO F39999-ITER-FI.
- In a function > F39, GDI produces:
GO TO F69999-ITER-FI.
In a generated Server, GDI branches to
the next occurrence of the current category, or to the next category.
- 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
The
following line is generated:
GO TO Fffss-900.
where ffss is
the function or subfunction whose level is indicated in the operands.Generated result for GT
The
following line is generated:
GO TO Fffss-FN.
where ffss is
the function or subfunction to which the statement belongs and whose
level is indicated in the operands.