Rational Programming Patterns

Syntactical rules in the Macro COBOL editor

The Macro COBOL editor is used to create and maintain the COBOL source of your Macros. It is important to be careful of the input format indicated in this page.

The identifiers

You must insert identifiers before COBOL statements, so that they can be inserted at the beginning of a program, in the WORKING-STORAGE SECTION or in the PROCEDURE DIVISION. The identifiers must be entered in the left margin, from column 1 to 6. The line numbers must be entered on a line following the line which contains the identifier. The lines of the Macro will be inserted in the locations indicated by the identifiers.

The identifying line is a line on which you define the location in a working area or the information relating to a function/subfunction. If your Macro contains an orphan line (a line which is not preceded by an identifying line), a message warns you.

Important: All lines containing an identifier or an attribute must be entered in uppercases. The line number is three characters long, and only the first two characters can be parameterized. You can enter alphanumeric characters in a WORKING-STORAGE SECTION, and numerical characters in a PROCEDURE DIVISION.
Table 1. Identifiers for beginning insertion
Paragraph to generate Identifier
  B$n$n
API COBOL comments. B__01
PAF comments. B__05
PROGRAM-ID B__10
AUTHOR B__20
DATE-COMPILED B__30
ENVIRONMENT DIVISION B__40
CONFIGURATION SECTION B00
SOURCE-COMPUTER B0000
OBJECT-COMPUTER B0010
SPECIAL-NAMES B0020
INPUT-OUTPUT SECTION B01
FILE-CONTROL B01
SELECT FF-FICHIER B01FF
I-O-CONTROL B0100
Only for line 'DATA DIVISION' B60
Only for line 'FILE SECTION' B99
Rewrite clause FD for file FF B9*FF
Table 2. In the working storage and linkage sections
Identifier Comment
WXX XX corresponding to the position in working section. Can be parameterized.
Table 3. Description of procedural code lines (functions, subfunctions)
Identifier Comment
FXXYY XX is the function code, YY is the subfunction code. Can be parameterized.
The indexes can be defined in different ways. To be generated under level 01 after the automatic indexes, you must enter the following identifiers. But take care, the level indicated for these indexes is 05:
Table 4. Indexes generated under level 01
Identifier Comment
IXXYY

XX = 2 characters, YY= 2 characters

Equivalent to table size in the working section. Indexes L, R, and M can be entered: IXXYYM initialized to the maximum value, IXYYL and IXXYYR initialized to zero.

JXXYY XX= function code, YY= subfunction code

Equivalent to the indexes used in the loop 'DO'.

To be generated in a level 01, you must enter them in a Wxx identifier (see table 2.

Note: All the indexes are generated in the same level of indexes. You can also define indexes on the Wxx identifier. See the following examples figure 1 and figure 3
Note: Some controls are implemented on the identifiers of lines, on the parameters for positioning function/subfunction (except the REF parameter). If an error is detected, a cross is displayed in the left column of the editor and the entity is marked in error in the workspace. As a result, the generation of programs calling this Macro becomes impossible.

Other syntactical rules

Examples

Figure 1. Indexes in the hierarchical level 01 of automatic indexes in a Macro:
Identifiers used to generate indexes in the hierarchical level 01 of the automatic indexes
Figure 2. Indexes in the hierarchical level 01 of a generated program:
Indexes in the hierarchical level 01 of the generated program
Figure 3. Indexes in the hierarchical level 01 of the working section, in a Macro:
Indexes in the hierarchical level 01 of the working section, in a Macro
Figure 4. Indexes in the hierarchical level 01 of the working section, in a generated program
Indexes in the hierarchical level 01 of the working section, in a generated program
Figure 5. Example of code entered in a Macro
Example of code entered in a Macro
Figure 6. Delete a section or paragraph at the beginning of a program

Specific case at the beginning of a program: the 'ACTION=R' attribute is used to delete a section or a paragraph.

Delete a section or paragraph at the beginning of a program

Terms of use | Feedback

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