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. 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 must declare a COBOL data name without any format.
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 is generated between the 01 DDSS-DELCO line and the VALUE SPACE line. - Declaration on one
line:
*!WI 01 DDSS-DELCO VALUE SPACENote: In this case, the PICTURE is generated after the 01 DDSS-DELCO line.
- *! 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.
*!WI
$1
or
*!WI
01 DDSS-DEL$1
Generated result
- 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.
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.