Setting allocation options for pointer areas

Use the Set Pointer Area Allocation menu item to reuse a pointer area or to reallocate a pointer area for a selected record.

About this task

z/OS® Automated Unit Testing Framework (ZUnit) supports pointer variables in linkages for COBOL programs and can allocate the pointer area in the STUB for a subprogram.

In the following sample program, LK1-AREA and LK2-AREA share the same pointer area. If a new area is allocated to INPUT-REQ-PTR in the subprogram SUB1, then LK2-AREA will use a different area from LK1-AREA. You can use the Set Pointer Area Allocation menu item to either reuse the allocated pointer area before calling the test program or allocate a new pointer area in the stub for the subprogram. You also have the option to apply your choice to all records in the test entry.

LINKAGE SECTION.
01 INPUT-REQ.
 02 INPUT-REQ-PTR POINTER. 
01 LK1-AREA.
 03 LK1-ITEM1 PIC X(20).
 03 LK1-ITEM1 PIC X(20). 
01 LK2-AREA.
 03 LK2-ITEM1 PIC 9(10).
 03 LK2-ITEM1 PIC 9(10). 
PROCEDURE DIVISION USING INPUT-REQ.
 SET ADDRESS OF LK1-AREA TO INPUT-REQ-PTR
 CALL "SUB1" USING INPUT-REQ
 SET ADDRESS OF LK2-AREA TO INPUT-REQ-PTR. 
In the Test Case Editor, the choice to reuse an allocated area is flagged as <allocated area>, while the choice to reallocate a pointer area is flagged as <reallocate>, as shown in the following example:
Allocation options in the Test Case Editor

Procedure

  1. In the Test Case Editor, double-click the Input data cell of a pointer node, or right-click the cell and select Set Pointer Area Allocation.
  2. In the Select Pointer Area Allocation window, choose one of these options:
    • Reuse the allocated pointer area
    • Reallocate pointer area
  3. To apply your choice to all records in the test entry, select the check box.