Data Division Conversion Rules
All data field declarations with usage DISPLAY are converted to usage NATIONAL.
-
A PIC X field is converted to a PIC N field.
-
A string literal in the context of PIC N field is prefixed with N symbol.
-
A PIC 9 field whose usage is DISPLAY is added USAGE NATIONAL clause to make its usage NATIONAL.
-
A group that all of its members can be converted to usage NATIONAL is added GROUP USAGE NATIONAL clause to make the group NATIONAL item.
Example 1: PIC X Field Converted to PIC N and String Literal Prefixed with N Symbol
The following example shows the PIC X field converted to PIC N. In addition the prefix N is added to the VALUE clause.
02 RECNAME-TBLB PIC X(9) VALUE 'APPL_TBLB'
Is converted to:
02 RECNAME-TBLB PIC N(9) VALUE N'APPL_TBLB'
Example 2: Usage NATIONAL clause added to PIC 9 Field
The following example shows the Usage NATIONAL clause added to the PIC 9 field.
02 CURR-COUNT PIC 9(4)
Is converted to:
02 CURR-COUNT PIC 9(4) USAGE NATIONAL
Example 3: GROUP-USAGE NATIONAL Clause Added to Group W-LIT
The utility adds the GROUP-USAGE NATIONAL clause to the group W-LIT, because all the members of the group can be converted to the national data type. W-CALC-FIELDS is not added GROUP-USAGE NATIONAL because it includes item that cannot be converted to national data type. Packed decimal, binary, pointer items are not converted to national type, and groups including these data types are not added GROUP-USAGE NATIONAL.
01 W-LIT GROUP-USAGE NATIONAL .
02 PROGRAM-NAME PIC N(8) VALUE N'PTPDEC31'.
02 JOBID PIC N(10) VALUE N'PTPDEC31'.
02 DESCR PIC N(16) VALUE
N'TEST DEC31'.
01 W-CALC-FIELDS.
02 INIT-CHAR-DEF PIC N(10).
02 COMP-REDEF-OF-CHAR REDEFINES INIT-CHAR-DEF
PIC S9(8) COMP.