Micropatterns to call Data Elements in the work and linkage areas

These micropatterns call Data Elements in the work and linkage areas of a Program, a Screen, a Server, or a Macro. These comments When the Program, Screen, or Server is generated again, these micropatterns are expanded with the Data Element format or usage from the repository.

Input format

You can insert these micropatterns in the WORKING-STORAGE SECTION and LINKAGE SECTION of the COBOL code in the PDP COBOL editor or the COBOL Source tab of the Macro 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.

You must declare a COBOL data name without any format.

Three types of micropatterns are specified in the same way. Only the micropattern identifier differs (WI, WE, or WS). This identifier determines which of the three Data Element formats is to be fetched upon the next generation.
Note: The following examples contain the WI micropattern but they are also valid for the WE and WS micropatterns.

To call a Data Element as a work or linkage area, you must enter one of the two following groups of lines. The Data Element format (COBOL PICTURE) is always generated after the Data Element call line.

  • Declaration on two lines:
          *!WI
           01              DDSS-DELCO
    	                     VALUE SPACE.
    Note: In this case, the PICTURE will be generated between the 01 DDSS-DELCO line and the VALUE SPACE line.
  • Declaration on one line:
          *!WI
           01              DDSS-DELCO	 VALUE SPACE
    Note: In this case, the PICTURE will be generated after the 01 DDSS-DELCO line.
These two groups of lines are constituted of the following elements:
  • *! 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.
  • WI is the micropattern identifier in the example. You can indicate one of the following identifiers:
    • WI to fetch the Data Element internal format,
    • WE to fetch the Data Element input format,
    • WS to fetch the Data Element output format.
  • 01 is the COBOL level.
    Note: In a Macro, the COBOL level can be parameterized.
  • DDSS-DELCO is the COBOL data name:
    • DD is the Data Structure code,
    • SS is the Segment code,
    • DELCO is the Data Element code, on 6 characters maximum. It must be preceded by a dash.
  • VALUE SPACE is the sample assignment of the SPACE value to the Data Element. This assignment is optional. You can enter it on the same line as the Data Element call or on the next line.
    • If you enter the VALUE on the same line, the PICTURE will be generated on the next line.
    • If you enter the VALUE on the next line, the PICTURE will be generated between the first line and the second line.
Note: A period is automatically added after generated code lines (code generated from the design, Macro calls, or micropattern calls). If the micropattern declaration ends with specific code (indication of a VALUE or an OCCURS for example), the period is not automatically added. You must then enter the period in the specific code.
In a Macro, you can parameterize the input, except the start and end tags. So for example, you can enter:
      *!WI
       $1
or
      *!WI
       01              DDSS-DEL$1

Generated result

When the COBOL code is generated again, the micropatterns are expanded with one of the Data Element formats (depending on the micropattern identifier) or usage. The following lines show examples of expanded micropatterns after the generation:
  • For a Data Element whose format is X and usage is D: DISPLAY, the following micropattern is generated:
          *!WI
           01      DDSS-DELCO
                     PICTURE X.
  • For a Data Element whose format is S9(4) and usage is 3: COMPUTATIONAL-3, the following micropattern is generated:
          *!WI
           01      DDSS-DELCO
                     PICTURE S9(4) COMP-3.
  • For a Data Element whose format is not specified and whose usage is J: COMPUTATIONAL-6, the following micropattern is generated:
          *!WI
           01      DDSS-DELCO
                     COMP-6.

Feedback