TP-COMMAREA generates a Working-Storage record for passing data between programs. This record contains AMB information as well as user data.
There is no need to code a TP-COMMAREA call; AMB generates it. The value of &TP-USER-LEN--the default is 80--determines the size of TP-USERAREA, the user portion of TP-COMMAREA. You can accept the AMB default of a single Commarea field, TP-USERAREA, or redefine TP-USERAREA as multiple Commarea fields.
The following calls pass a Commarea:
SEND | Send a screen to the terminal and terminate the program. CICS saves the data stored in the TP-COMMAREA and makes it available to the next program when AMB returns the screen to CICS. |
LINK | Link to a subprogram, passing it the TP-COMMAREA address. Define COMMAREA identically in each program. |
XCTL | Transfer control to another program, passing a copy of TP-COMMAREA. Define TP-COMMAREA identically in both programs. |
You can redefine TP-USERAREA to fit program requirements.
Optionally, you can code the redefinition in a copybook or rule that you include.
SYM1 % * SET THE LENGTH OF TP-USERAREA TO % * 21 BYTES % &TP-USER-LEN = 21 CA AACA-USERAREA CA-DATE X8 CA-TIME X8 CA-CUST-NUMBER X5 SYM1 % * SET THE LENGTH OF TP-USERAREA TO % * 21 BYTES % &TP-USER-LEN = 21 CA05 AACA-USERAREA 10 CA-DATE X8 10 CA-TIME X8 10 CA-CUST-NUMBER X5
AACA-USERAREA CA-DATE X8 CA-TIME X8 CA-CUST-NUMBER X5
01 TP-COMMAREA . . . 01 FILLER REDEFINES TP-COMMAREA. 05 FILLER PIC X(40). 05 TP-USERAREA PIC X(21). 05 AACA-USERAREA REDEFINES TP-USERAREA. 10 CA-DATE PIC X(08). 10 CA-TIME PIC X(08). 10 CA-CUST-NUMBER PIC X(05).
TP-COMMAREA generates a Working-Storage record for passing data between programs. This record contains AMB information and user data.
There is no need to code a TP-COMMAREA call; AMB generates it. The value of &TP-USER-LEN--the default is zero-- determines the size of TP-USERAREA, the user portion of TP-COMMAREA. You can accept the AMB default of a single Commarea field, TP-USERAREA, or redefine TP-USERAREA as multiple Commarea fields. You must define the Commarea in Working-Storage.
To redefine TP-USERAREA as a group-level data structure, the length must be the same as the value specified for &TP-USER-LEN. A CA01 keyword generates an 05-level REDEFINES TP-USERAREA statement.
To generate a single-field Commarea in Working-Storage called TP-USERAREA, assign a value to the AMB variable &TP-USER-LEN. Code the following on one line.
SYM1 % &TP-USER-LEN = number
To receive TP-COMMAREA as a passed data area from a calling program, code this assignment statement before NTRY.
% &DLG-COMMAREA-IN-LINKAGE = "YES"
The results are:
01 DLG-LINKAGE-COMMAREA PIC X(&TP-USER-LEN).
... USING DLG-LINKAGE-COMMAREA
Program Painter source:
SYM1 % &TP-USER-LEN = 49 CA05 PGM-USERAREA 10 CA-EMPLOYEE-NAME PIC X(20). 10 CA-EMPLOYEE-TITLE PIC X(20). 10 CA-EMPLOYEE-SSN PIC X(09).
Generated source:
01 TP-COMMAREA. 05 TP-USERAREA PIC (X49). 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).
TP-COMMAREA coordinates the placement of the AMB-generated Commarea structure with a user-provided redefinition of that structure. Use it only with conversational IMS programs - nonconversational IMS programs do not use a Commarea.
In IMS, the Commarea is called a SPA (Scratch Pad Area). Its reserved prefix includes an IMS LLZZ field, the input trancode, and the AMB invocation mode flag.
There is no need to code a TP-COMMAREA call; AMB generates it. The value of &TP-USER-LEN--the default is 0--determines the size of TP-USERAREA, the user portion of TP-COMMAREA. You can accept the AMB default of a single Commarea field, TP-USERAREA, or redefine TP-USERAREA as multiple Commarea fields. You must define the Commarea in Working-Storage.
To redefine TP-USERAREA as a group-level data structure, the length must be the same as the value specified for &TP-USER-LEN. A CA01 keyword generates an 05-level REDEFINES TP-USERAREA statement.
To generate a single-field Commarea in Working-Storage called TP-USERAREA, assign a value to the AMB variable &TP-USER-LEN. Code the following on one line.
SYM1 % &TP-USER-LEN = number
SYM1 % &TP-USER-LEN = 100 CA05 MY-REDEF 10 CA-FLD-A PIC X(10). 10 CA-FLD-B PIC S9(4) COMP. 10 CA-FLD-C PIC X(20).
% &TP-USER-LEN = 100 IDENTIFICATION DIVISION . . WORKING-STORAGE SECTION. $TP-WS-MARKER $TP-COMMAREA 05 MY-REDEF REDEFINES TP-USERAREA. 10 CA-FLD-A PIC X(10). 10 CA-FLD-B PIC S9(4) COMP. 10 CA-FLD-C PIC X(20).