Identifiers, line numbers, and attributes in the migrated Macros

This page explains how the information of the Macro -B, -W, and -P screens in Pacbase is displayed in the Macro COBOL Source tab in Rational® Programming Patterns. The origin of the identifiers, line numbers, and attributes is then detailed for the beginning of a program, the WORKING-STORAGE SECTION, and the PROCEDURE DIVISION.

Note: For explanations on the line numbers in merged Macros, see Line numbers in the migrated merged Macros.

Beginning of a program

In Pacbase, the lines that modify the beginning of a program are indicated in the Macro -B screen. Their positions are specified in the SE (section to generate) and PA (paragraph to generate) fields.

After the Macro is migrated to Rational Programming Patterns, it contains the following lines:
  • The first line contains only the BSEPA identifier, where SE is the section and PA the paragraph.
  • The following lines contain the line numbers and descriptions of the instructions as they are entered in Pacbase.
Example: In the following example, the instructions are indicated, in Pacbase, in the -B screen of Macro MACB01, in section 01 and paragraph A2. In the COBOL source editor, the first line contains the identifier B01A2. The following lines contain the line numbers and contents of the Pacbase lines.
Figure 1. Beginning insertions in a Macro
This example shows the Pacbase screen of a Macro and the corresponding content of the Macro in the COBOL source editor. Their contents are described in the preceding explanations.

WORKING-STORAGE SECTION

Identifier and line number
In Pacbase, the placement of the work area lines is indicated by a two-character code in the Code for placement field of the Macro -W field.
After the Macro is migrated to Rational Programming Patterns, it contains the following lines:
  • A line with only the placement identifier of the description: WXX where XX represents the 2 characters of the code for placement in Pacbase.
  • The following lines contain the line numbers and descriptions of the instructions as they are indicated in Pacbase.

In the WORKING-STORAGE SECTION, the Pacbase line numbers are kept. They are on 3 characters.

Example: In the following example, the value XW is entered, in Pacbase, in the Code for placement field of the -W screen of Macro AAER09. In the COBOL source editor, the first line contains only the WXW identifier. The following lines contain the line numbers of contents of the Pacbase lines.
Figure 2. WORKING-STORAGE SECTION lines in a Macro
This example shows the Pacbase screen of a Macro and the corresponding content of the Macro in the COBOL source editor. Their contents are described in the preceding explanations.
Table size index
In Pacbase, a table size index is automatically generated if the Occurs field of the Macro -W screen contains a value.
After the Macro is migrated to Rational Programming Patterns, it contains the following lines:
  • A line with only the IXXNNL index identifier, where XXNN represents 2 codes on 2 characters each (Data Structure and Segment for example).
  • The 3 indexes that are automatically generated from the table declaration: IXXNNL for the number of the records that are stored in the table, IXXNNR for the table search, and IXXNNM for the maximum number of records. The line numbers of these 3 lines correspond to the line number of the table declaration line in Pacbase.
Example: In the following example, the value 9 is indicated, in Pacbase, in the Occurs field of the -W screen of Macro AADOCP. The line number of this declaration is 300. In the COBOL source editor, the first line contains only the IWP20 identifier, where WP20 is the Segment that represents the table. The other three lines correspond to the three indexes that are automatically generated, with the line number 300.
Figure 3. Table size indexes in a Macro
This example shows the Pacbase screen of a Macro and the corresponding content of the Macro in the COBOL source editor. Their contents are described in the preceding explanations.
Loop management index
In Pacbase, an index for the management of a DO loop is automatically generated if the LVTY (level and type of structure of condition) field of the Macro -P screen contains a subfunction whose condition is DO (10DO for example).
After the Macro is migrated to Rational Programming Patterns, it contains the following lines:
  • The first line contains only the JFFSS identifier, where FFSS is the function and subfunction code.
  • The following line contains the SSR identifier, where SS is the subfunction code.
Example: The following example illustrates the declaration of an index for a DO loop in subfunction 31GB. In Pacbase, the value 20DO is indicated in the LVTY field of the -P screen of Macro MAOPGN. In the COBOL source editor, the first line contains the identifier J31GB. The following line contains the identifier GBR.
Figure 4. Index for the management of a DO loop
This example shows the Pacbase screen of a Macro and the corresponding content of the Macro in the COBOL source editor. Their contents are described in the preceding explanations.

PROCEDURE DIVISION

Identifiers and attributes
In Pacbase, the function and subfunction identifiers are specified in the Macro -P screen. The function is indicated in the screen header, in the Function screen. The subfunction is indicated on each screen line, in the SS field.

After the Macro is migrated to Rational Programming Patterns, it displays the identifiers on the first specific code line that corresponds to the subfunction as FFFSS, where FFSS is the function and subfunction code.

In Pacbase, the function and subfunction attributes are entered in the Macro -P screen. They are constituted of the elements that are entered on the subfunction N line. These elements include the level, title, and condition of the subfunction. They might also include various elements that depend on the model (batch, dialog, or client/server).

After the Macro is migrated to Rational Programming Patterns, it displays the attributes as comments, which are preceded by an asterisk in column 07, in the following way:
  • The optional title line is displayed under the identifier line, on the line 000 of the subfunction. The title line displays the subfunction code after N. The title is displayed after NOTE.
  • The following line, without any line number, displays the other elements of line N.
Example: In the following example, subfunction S2 is inserted into function 20 in Pacbase. The subfunction identifier is displayed as F20$2 in the COBOL source editor. The following two lines are attributes lines. The first line contains the title. The second line contains the level (LV=15), the placement after the Dialog automatic function 20 (ACTION=*P) and the parameter that represents the Data Element to be controlled (REF=$6).
Figure 5. Identifier and attributes of a subfunction in a Macro
This example shows the Pacbase screen of a Macro and the corresponding content of the Macro in the COBOL source editor. Their contents are described in the preceding explanations.
Condition lines
In Pacbase and Rational Programming Patterns, the condition line numbers are on 3 characters.

The Pacbase line that contains the code in the Operands field and the condition in the LVTY field (level and condition) is split into two lines in the COBOL source editor. The first line contains only the condition and keeps the Pacbase line number. The second line contains the code that depends on the condition. Its line number is on 6 characters. The first 3 characters are the number of the last condition line. There are two condition lines, for example, if an IT condition is followed by an OR condition. The last 3 characters of the line number are the current code line number.

The DOT annotation in uppercase letters in the right margin generates a period at the end of the preceding line. It replaces the level 99 in the Pacbase Macros.
Note: In the COBOL generated code and specific code of a Program, Screen, or Server, you must add dot in lowercase letters in the right margin to generate a period at the end of the preceding line.
Example: In the following example, the code that is indicated on the line 100 of subfunction F60$6 is run if the condition ICATR > IRR is met. The code inserts the comment END OF LIST. In Pacbase, the condition and the code are indicated on the same line, whose number is 100. However, in the COBOL source editor, two lines are displayed. The first, whose number is 100, contains the condition and the DOT annotation. The second line contains the code. Its line number is 120100 because it follows the second and last condition line, which starts with OR and whose line number is 120.
Figure 6. Macro line numbers in the PROCEDURE DIVISION
This example shows the Pacbase screen of a Macro and the corresponding content of the Macro in the COBOL source editor. Their contents are described in the preceding explanations.

Feedback