In an OS/VS COBOL CICS program, you would access chained storage areas by defining in the LINKAGE SECTION a storage area that contains a pointer to another storage area. You would then access the next chained area by copying the address of the next area into the associated BLL. It was also necessary to code a paragraph name following any statement that modified the contents of the BLL cell used to address the chained areas. With Enterprise COBOL, this chaining is simplified by using the SET statement to set the address of the chained area.
During conversion, do the following steps:
OS/VS COBOL Enterprise COBOL
WORKING-STORAGE SECTION. WORKING-STORAGE SECTION.
01 WSDATA-HOLD PIC X(100). 01 WSDATA-HOLD PIC X(100).
. .
. .
LINKAGE SECTION. LINKAGE SECTION.
01 PARAMETER-LIST. .
. .
. .
05 CHAINED-POINTER PIC S9(8) COMP. .
. .
. .
01 CHAINED-STORAGE. 01 CHAINED-STORAGE.
05 CHS-NEXT. PIC S9(8) COMP. 05 CHS-NEXT. USAGE IS POINTER.
05 CHS-DATA PIC X(100). 05 CHS-DATA PIC X(100)
. .
. .
PROCEDURE DIVISION. PROCEDURE DIVISION.
. .
. .
MOVE CHS-NEXT. TO CHAINED-POINTER. SET ADDRESS OF CHAINED-STORAGE TO CHS-NEXT.
ANY-PARAGRAPH-NAME.
MOVE CHS-DATA TO WSDATA-HOLD. MOVE CHS-DATA TO WS-DATA-HOLD.
. .
. .