Rational Programming Patterns

Micropatterns for Data Element calls in the work and linkage areas

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

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 these micropatterns in the WORKING-STORAGE SECTION and LINKAGE SECTION of the COBOL code, using the PDP COBOL editor or 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.

You must declare a COBOL data name without any format.

There are three types of micropatterns, which are specified in the same way; only the micropattern identifier differs. This identifier determines which of the three Data Element formats is to be fetched upon the next generation.

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):
      *{WXx
       01      DDSS-DELCO
	             VALUE SPACE.
      *}
or
      *{WX
       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.
  • WX is the micropattern identifier. x must be:
    • I in order to fetch the Data Element internal format,
    • E in order to fetch the Data Element input format,
    • S in order 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 six characters maximum. It must be preceded by a dash and followed by a point or a blank.
  • *} 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.
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. For example, for a Data Element whose format is:
  • X and usage is D: DISPLAY, the generated micropattern is:
          *{WX
           01      DDSS-DELCO
                     PICTURE X.
          *}
  • S9(4) and usage is 3: COMPUTATIONAL-3, the generated micropattern is:
          *{WX
           01      DDSS-DELCO
                     PICTURE S9(4) COMP-3.
          *}
  • Left blank and usage is J: COMPUTATIONAL-6, the generated micropattern is:
          *{WX
           01      DDSS-DELCO
                     COMP-6.
          *}

Terms of use | Feedback

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