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. Both result in the same generation:
*!WI
01 DDSS-DELCO
VALUE SPACE
or *!WI
01 DDSS-DELCO VALUE SPACE
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.
- 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.
Note: 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 Program, Macro,
Screen, or Server 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.