Rational Programming Patterns

Micropattern for Data Structure calls in the work and linkage areas

This micropattern is a formatted comment inserted in the code of a Program or a 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.

Recognition of the Pacbase generation

When a Program, Screen, or Server is generated with the GPRT procedure (C9 option), all the calls to Data Elements and Data Structures on -W lines (on lines with an E, I, S, or F type) are generated as micropatterns.

The generator adds:
      *{WX 'micropattern contents' enabled=false 
      *}

It adds the * character to indicate that it is a comment, the opening and closing braces, and indicates the micropattern identifier (W followed by the line type in the -W lines).

It also adds the enabled=false property, except if the COBOL comes from a Macro. After the instance is generated in Rational® Programming Patterns, this property draws your attention to any differences detected against the micropattern generated in Pacbase. As long as this property remains in the COBOL code of the generated instance, the micropattern generated from Pacbase is kept.

If differences are detected, the COBOL generated from Pacbase is kept and the property remains as is.

If no difference is detected, the property is automatically removed from the COBOL code.

If you want to keep the local generation in spite of the differences, you must manually remove the enabled=false property from the COBOL code. If you keep it, any local modifications brought to the micropattern will be overwritten upon the next generation.

After the property is removed, you can update your micropattern from Rational Programming Patterns. These updates will be taken into account upon the next generation.

Input format

You can insert this micropattern in the WORKING-STORAGE SECTION and LINKAGE SECTION of the COBOL code, using the PDP COBOL editor.
Note: You can enter the micropattern in full or use the data entry form 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, specify its parameters, and indicate the micropattern end line.

For example:
*{WF  DSL=GD DSP=G1 SEL=01 FOR=I LEV=1 ORG=2 DES=1 SSC=3 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.
  • *} 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.

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 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 DS 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 DS 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 varying 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 D.S. 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 which is to be used in the COBOL to provide different uses of the Segment description 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 DS 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 which 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 DS 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 varying 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 varying 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  
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 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.

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.

Figure 1. Sample generated result
Sample result of the expansion of a WF micropattern

Terms of use | Feedback

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