Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.
Accept or override the default length (80 bytes) of the Commarea field and optionally redefine it into multiple fields. For main programs, do this in Working-Storage; for sub programs, do this in the Linkage Section.
- To assign a length to TP-USERAREA, type the variable value assignment statement, &TP-USER-LEN, in column 12, and the keyword SYM1 in the columns 4 through 7. SYM1 places the variable at the top of your program. For example:
SYM1 &TP-USER-LEN = 49
Generated AMB source:
01 TP-COMMAREA.
.
.
05 TP-USERAREA PIC X(49).
-
To redefine TP-USERAREA, type a redefinition data structure directly into the program, or put it into a data structure object and include it in the program. Use any of the following keyword/source code combinations:
- CA05 - Define a COBOL redefinition data structure in the program. For example:
SYM1 &TP-USER-LEN = 49
.
.
CA05 CA-REDEF.
10 CA-EMPLOYEE-NAME PIC X(20).
10 CA-EMPLOYEE-TITLE PIC X(20).
10 CA-EMPLOYEE-SSN PIC X(09).
Generated AMB source:
01 TP-COMMAREA.
.
.
.
01 CA-REDEF REDEFINES TP-COMMAREA.
05 FILLER PIC X(40).
05 TP-USERAREA PIC X(49).
05 CA-REDEF REDEFINES TP-USERAREA.
10 CA-EMPLOYEE-NAME PIC X(20).
10 CA-EMPLOYEE-TITLE PIC X(20).
10 CA-EMPLOYEE-SSN PIC X(09).
- CADS - Define a redefinition data structure object and include it in the program with the CADS keyword. For example:
CADS PGM-USERAREA
The generated AMB source is identical to the source generated by the CA05 keyword in the example above.
- CA - Using the Data Structure Editor format, define a redefinition data structure in the Program Painter. For example:
SYM1 &TP-USER-LEN = 49
.
.
.
CA PGM-USERAREA
10 CA-EMPLOYEE-NAME X20
10 CA-EMPLOYEE-TITLE X20
10 CA-EMPLOYEE-SSN X09
The generated AMB source is identical to the source generated by the CA05 keyword in the example above.
Generated AMB source:
01 TP-COMMAREA.
.
.
.
01 FILLER REDEFINES TP-COMMAREA.
05 TP-USERAREA PIC X(49).
05 PGM-USERAREA REDEFINES TP-USERAREA.
10 CA-EMPLOYEE-NAME PIC X(20).
10 CA-EMPLOYEE-TITLE PIC X(20).
10 CA-EMPLOYEE-SSN PIC X(09).
Using the CA keyword:
SYM1 &TP-USER-LEN = 49
.
.
.
CA PGM-USERAREA
10 CA-EMPLOYEE-NAME X20
10 CA-EMPLOYEE-TITLE X20
10 CA-EMPLOYEE-SSN X09
The generated AMB source is identical to the source generated by the CA05 keyword in the example above.
Using the CADS keyword:
CADS PGM-USERAREA