Micropattern for Data Structure calls in the work and linkage areas

This micropattern is a formatted comment that is inserted in the code of a Program, Screen, Server, or Macro. This comment calls a Data Structure in the work and linkage areas. When the instance is generated again, the micropattern is expanded with the Data Structure description.

Input format

You can insert this micropattern 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 data entry forms available from the Rational Developer for System z Snippets view, in the RPP snippets category.

To indicate a Data Structure in the work and linkage areas, you must enter a micropattern call line and specify its parameters.

For example:
*!WF  DSL=GD DSP=G1 SEL=01 FOR=I LEV=1 ORG=2 DES=1 SSC=3 BLC=BDT000 GRP=N 
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.
  • WF is the micropattern identifier. It is required.

Only the DSL= parameter, which contains the Data Structure code to be used, is required. If the other parameters are not entered, their default values are taken into account.

You can enter the parameters in any order.

The parameters

DSL=
Enter the code of the Data Structure to be used. This parameter is required.
DSP=
Enter the code of the Data Structure in the program.

The first character must be alphabetic but the second character can be numeric or alphabetic. With this code, you can differentiate several calls of the same Data Structure in a Program.

If this code is not entered, the code indicated in the DSL= parameter is taken into account.

SEL=
Enter a selection of the Segments belonging to this Data Structure. If this parameter is not entered, all the Segments of the Data Structures are taken into account.

Enter the last two characters of the Segment codes one after the other, without separation.

You can rename a Segment by entering an = symbol between the initial Segment and the renamed Segment (for example: 01=02).

FOR=
Enter the format of the Data Elements that are called in the Segments of the Data Structure (internal (I), input (E) or output (S)).

If this parameter is not entered, the internal format is taken into account.

LEV=
Enter the COBOL record level. If this parameter is not entered, the record level 1 is taken into account.

This option is used with the DES parameter. It defines the COBOL level number for the descriptions of Data Structures, Segments, and Data Elements. In the following descriptions, the expression "D.S. area" is meant as the dd00 area (possibly 1-dd00, 2-dd00).

The possible values are:
Table 1. Possible values for the COBOL record level
Values Comments
1 COBOL level 01 for D.S. area and Segments (default value)

If the Data Structure description is included in the COBOL FILE SECTION, the Segments must be redefined. If a Data Structure has no common part with a non-redefined description, the D.S. area is only included when the DES parameter (description type) is set to blank (redefined records).

2 COBOL level 01 for D.S. area and level 02 for Segments.

If the DES parameter (description type) is set to blank (redefined records), the D.S. area and Segments are described at level 02.

3 COBOL level that varies with records description type

Level 02 for D.S. area and level 03 for Segments if the DES parameter (description type) is set to 1, 2, or 3.

Level 01 for D.S. area and level 03 for Segments if the DES parameter is set to 4.

Level 03 for both the Data Structures and Segments if the DES parameter is set to blank (redefined records).

4 COBOL level 02 for the first-level Data Elements.

Level 02 for the group Data Elements or elementary Data Elements that are not part of a group. The elementary Data Elements that are part of a group are displayed but the D.S. area and Segment levels are not included.

Level 01 is to be defined in the work areas.

5 COBOL level 01 for the first-level Data Elements.

Level 01 for the group Data Elements or elementary Data Elements that are not part of a group. The elementary Data Elements that are part of a group are displayed but the D.S. area and Segment levels are not included.

6 COBOL level 02 for the first-level Data Elements.

COBOL level 02 for group Data Elements or elementary Elements that are not part of a group.

The elementary Data Elements that are part of a group are not included. The D.S. area and Segment levels are not included either.

For standard OnLine Systems Development Screens only.

7 COBOL level 01 for the first-level Data Elements.

COBOL level 01 for group Data Elements or elementary Elements that are not part of a group.

The elementary Data Elements that are part of a group are not included. The D.S. area and Segment levels are not included either.

For standard OnLine Systems Development Screens only.

DES=
Enter the type of record description that is to be used in the COBOL to provide different uses of the Segment description that is stored in the Library

If this parameter is not entered, the blank description type (redefined records) is taken into account.

Table 2. Possible values for the description type
Values Comments
(blank) Redefined records

No VALUE clause is generated

1 Records without initial values

These records are presented with the Segment common part followed by the different specific parts.

If the Data Structure description is included in the COBOL FILE SECTION, the LEV parameter must be set to 2 (COBOL level 01 for D.S. area and level 02 for Segments).

2 Records with initial values

Records with the specific initial values indicated in the Segment -CE Lines tab. These values can also default to blank or zero depending on the format.

Initial values are also generated for the multiple occurrence fields if the Generated language of the Library is set to D: COBOL II, 85, LE.

3 Records with repetitions (used with level 2)

Records that incorporate the number of occurrences indicated in the Table size field of the Segment Definition.

If the Data Structure description is included in the COBOL FILE SECTION, the LEV parameter must be set to 2 (COBOL level 01 for D.S. area and level 02 for Segments).

This type of description cannot be used if the common part Segment of this Data Structure is assigned a value in the Table size field of the Segment Definition tab.

4 Records with repetitions (used with level 3)

Records which incorporate the number of occurrences indicated in the Table size field of the Segment Definition.

The associated LEV parameter must be set to 3 (COBOL level that varies with records description type).

Comment specific to the OnLine Systems Development function: The index is not generated if the LEV parameter is set to 3 (COBOL level that varies with records description type).

The COBOL level 02 is used to access the table constituted of the repetition of the same record (ddssT).

The COBOL level 01 is used to group the whole Data Structure (common or specific parts, whether occurred or not). A group level field that incorporates all the instances is generated.

This type of description cannot be used if the common part Segment of this Data Structure is assigned a value in the Table size field of the Segment Definition.

ORG=
Enter the organization of the Data Structure if the Data Structure is to be generated as the description of a Pactables Table or as a database description (when the Database Description function is not used).
Table 3. Possible values for the organization
Values Comments
A Reserved for an ADABAS file description in the definition programs or usage programs of the database.
D Reserved for the description of Segments or records of the IMS (DL/1), IDS I or IDS II databases, in the generation of DBD, SYSGEN, schemas, or application programs
G Table description.

This value generates the communication area with the Pactables function.

M Reserved for the description of DATACOM DB database structure.
N Reserved for the description of NONSTOP SQL database structure.
P No comment
Q Reserved for the description of SQL/DS, DB2/2 or DB2/6000 databases (IBM), or ALLBASE/SQL databases (HP3000), or DB2/2 or DB2/600 databases (MICRO FOCUS).
2 Generation and description of a DB2 or VAX/SQL Segment. Only the physical accesses are not generated. The structure of the variable indicators corresponding to the columns of the DB2 or VAX/SQL table is always generated.
9 Reserved for the description of an INFORMIX, SYBASE, INGRES/SQL, and SQL SERVER database Structure.
SSC=
Enter a subschema.

A subschema is a group of Data Elements that are called in the Segment.

This parameter is used with the Pactables function to indicate which subschema is to be described. It is numeric, from 0 to 9 (0 corresponds to subschema 10).

If this parameter is not entered, no subschema is selected.

GRP=
Enter this parameter (GRP=N) if Segments are not to be grouped by Data Structures in the generated code of a batch Program.

If you do not enter this parameter, all the Segments of a Data Structure will be grouped.

BLC=
Enter the Database Block. When the DESCR=ALL option is indicated on the Database Block, the group Data Elements and the redefinitions are generated in the Segment description.
PLT=
This parameter represents the Code for placement for the work areas in Pacbase. It was implemented for migration purposes only. This information no longer exists in the Rational Programming Patterns model, so it is must not be used to maintain applications.

Generated result

When the Program is generated again, the micropattern is expanded with the Data Structure description, according to the parameters entered on the micropattern call line.

The following lines show the example of an expanded WF micropattern after a generation::
*!WF DSL=CU DSP=C1 SEL=0010 FOR=I LEV=1 DES=1
 01                 C100.
      10	           C100-CUSTID PICTURE  9(8).
      10	           C100-NAME   PICTURE  X(15).
      10	           C100-FNAME  PICTURE  X(15).
      10	           C100-DD10.
      11	           C100-WAY    PICTURE  X(20).
      11	           C100-ZIPCOD PICTURE  X(5).
      11	           C100-CITY   PICTURE  X(20).
      11	           C100-STATUS PICTURE  X.
 01                 C110.
      10	           C110-CUSTID PICTURE  9(8).
      10	           C110-NAME   PICTURE  X(15).

Feedback