Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Compiler and Runtime Migration Guide


Example 2: Processing storage areas that exceed 4K

In OS/VS COBOL, if a LINKAGE SECTION area was greater than 4096 bytes in length, then you would have to include statements to provide addressability to the entire storage area. For Enterprise COBOL programs, these statements are no longer necessary.

The following example shows the coding for both an OS/VS COBOL program and an Enterprise COBOL program.

During conversion, do the following steps:

  1. Remove the following statements used to maintain addressability:
        ADD +4096 TO RECORD-POINTER ...
        SERVICE RELOAD ...
  2. Change the SET option of the CICS command from an intermediate BLL cell to the ADDRESS OF special register for the record.
           OS/VS COBOL                                    Enterprise COBOL 

LINKAGE SECTION.                                   LINKAGE SECTION.
 01 PARMLIST.
    .
    .
    05  RECORD-POINTERA  PIC S9(8) COMP.
    05  RECORD-POINTERB  PIC S9(8) COMP.
    .
    .
 01 FILE-RECORD.                                   01 FILE-RECORD.
    05  REC-AREA1         PIC X(2500).                05  REC-DATA1       PIC X(2500).
    05  REC-AREA2         PIC X(2500).                05  REC-DATA2       PIC X(2500).
    .                                                     .
    .                                                     .
PROCEDURE DIVISION.                                PROCEDURE DIVISION.
    .                                                     .
    .                                                     .
    EXEC CICS READ DATASET("INFILE")                   EXEC CICS READ DATASET("INFILE")
       RIDFLD(INFILE-KEY)                                   RIDFLD(INFILE-KEY)
       SET(RECORD-POINTERA)                                 SET(ADDRESS OF FILE-RECORD)
       LENGTH(RECORD-LEN)                                   LENGTH(RECORD-LEN)
    END-EXEC                                           END-EXEC
    SERVICE RELOAD RECORD-POINTERA
    ADD +4096 TO RECORD-POINTERA
        GIVING RECORD-POINTERB
    SERVICE RELOAD RECORD-POINTERB.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)