Rational Programming Patterns for System z

OnLine Systems Development and Pacbench C/S micropatterns

You can insert these micropatterns in the COBOL code of all the Screen and Server types with the PDP COBOL editor, or in the code of a Macro with the PDP Macro editor.

Branching micropatterns

These micropatterns generate GO TO statements.

You must conform to the following input format:
      *{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: GF, GFA, GD or GDB.
  • *} 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.
These micropatterns generate different types of branching:
  • GF branches to the end of the automatic function or subfunction in which the line is inserted.
    Note: It can be inserted in *x-type subfunctions associated with automatic subfunctions (F20, F25 ...).
    It generates:
      GO TO Fffss-FN.
    where ffss is the code of the associated automatic function or subfunction.
  • GFA branches to the end of the display processing:
      GO TO END-OF-DISPLAY.
  • GFR branches to the end of the reception processing
      GO TO END-OF-RECEPTION.
  • GDB branches to the beginning of the current iteration.
      GO TO Fffss-FN.
    where ffss is the function or subfunction code.

Micropatterns for calling Screens or C/S Screens

Micropatterns for Segment accessing

You must conform to the following input format
      *{MP "segm"
      *}
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 (see the table for the list of the identifiers).
  • " " must frame the operands.
  • segm is the Segment code.
  • *} 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.
Note: The Segment code is not controlled.
Table 1. Micropatterns for Segment accessing
Micropattern identifiers Generated result
XD Deletion of the Segment indicated in the operands
XP Read of the first record through a dynamic access. This micropattern always retrieves a record.
XR Read of the Segment indicated as the operands
XRN Sequential read of the Segment indicated in the operands (dynamic access)
XRU Read before update of the Segment indicated in the operands
XRW Rewrite of the Segment indicated in the operands
XUN Unlock of the Segment indicated in the operands. (except for DL1).
XW Write of the Segment indicated in the operands
Note: For the OnLine Systems Development function, these micropatterns can generate the corresponding access function. When the Segment is an SQL view or table, make sure that the Segment is defined in the Screen with either a reception or a display use. The XP and XRN micropatterns are reserved for Segments defined in a repetitive category with a display use.

Micropatterns for error positioning

These errors are detected by specific code. They can be associated with a Data Element called on a Screen , C/S Screen, or Server (ERR micropattern), or they can be common to all the Screens of a Dialog or all the Servers of a Server Dialog (ERU micropattern).
  • Enter the ERR micropattern with the following input format:
          *{ERR "n delco ind" LV="view"
          *}
    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.
    • ERR is the micropattern identifier.
    • " " must frame the operands.
    • n is the error code, on one position. This code is an alphanumeric character (except for '0' or '1', which are reserved for the coding of documentary messages).
    • delco is the variable Data Element with which the error code is associated. Entering this Data Element is required.
    • ind is an optional operand, specific to Servers. It represents an index. Its code and length are free.
    • LV="view" is an optional attribute, specific to Servers. view represents the code of a Logical View. You specify this attribute only if there is no Logical View, to generate the micropattern with this Logical View.
    • *} 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.
    The error message corresponding to the error code is specified on the -GE Lines of the Screen. The cursor will be positioned and the Data Element will take on the attributes defined for the Data Elements in error.
    Note: For a repetitive Data Element, its code is indicated, followed by the sequence number of the Data Element instance (DELCO (2) for example).
  • Enter the ERU micropattern with the following input format:
          *{ERU "nnnn delco"
          *}
    où :
    • *{ 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.
    • ERU is the micropattern identifier.
    • " " must frame the operands.
    • nnnn is the error code, on four positions, managed by the user.
    • delco is the erroneous Data Element. Entering this Data Element is optional.
    • *} 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.
    The error message corresponding to the error code is specified on the -GE Lines of the Dialog. This message will be displayed on the error message line (ERMSG). If a Data Element has been specified, the cursor will be positioned on the Data Element, and error attributes will apply.
    Note: This micropattern cannot be used on a repetitive Data Element.

Other micropatterns


Terms of use | Feedback

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