Conversion to Enterprise COBOL

Many of the changes in the CICS®-COBOL interface occur because Enterprise COBOL simplifies the procedures. This means that you do not need to use some CICS-specific OS/VS COBOL programming techniques. Of the changes described in this section, the only one that is mandatory is the replacement (removal) of all PROCEDURE DIVISION references to BLL cells.

Based addressing

Do not define and manipulate BLL cells. Review programs that use the CICS SET option and BLL cells, and make the following changes:

Table 48. Addressing CICS data areas in locate mode
OS/VS COBOL Enterprise COBOL
WORKING-STORAGE SECTION.
 77 LRECL-REC1 PIC S9(4) COMP.
LINKAGE SECTION.
 01 BLLCELLS.
    02 FILLER PIC S9(8) COMP.
    02 BLL-REC1A PIC S9(8) COMP.
    02 BLL-REC1B PIC S9(8) COMP.
    02 BLL-REC2 PIC S9(8) COMP.
 01 REC-1.
    02 FLAG1   PIC X.
    02 MAIN-DATA PIC X(5000).
    02 OPTL-DATA PIC X(1000).
 01 REC-2.
    02 ....
    .
    .
 PROCEDURE DIVISION.
     EXEC CICS READ UPDATE.
          .
          .
          SET(BLL-REC1A)
          LENGTH(LRECL-REC1)
          END-EXEC.
     ADD 4096 BLL-REC1A GIVING BLL-REC1B.
     SERVICE RELOAD REC-1.
     IF FLAG1 EQUAL X'Y'
           MOVE OPTL-DATA TO ...
           EXEC CICS REWRITE...
                FROM(REC-1)
                LENGTH(LRECL-REC1)
                END-EXEC.
WORKING-STORAGE SECTION.
 77 LRECL-REC1 PIC S9(4) COMP.
LINKAGE SECTION.
01 REC-1.
   02 FLAG1 PIC X.
   02 MAIN-DATA PIC X(5000).
   02 OPTL-DATA PIC X(1000).
01 REC-2.
   02 ...
   .
   .
PROCEDURE DIVISION.
EXEC CICS READ UPDATE
     .
     .
     SET(ADDRESS OF REC-1)
     LENGTH(LRECL-REC1)
     END-EXEC.
IF FLAG1 EQUAL X'Y'
     MOVE   OPTL-DATA TO ...
     EXEC CICS REWRITE
          .
          .
          FROM(REC-1)
          END-EXEC.

This table shows the replacement of BLL cells and SERVICE RELOAD in OS/VS COBOL by the use of ADDRESS special registers in Enterprise COBOL . If the records in the READ or REWRITE commands are fixed length, Enterprise COBOL does not require a LENGTH option. This example assumes variable-length records. After the read, you can get the length of the record from the field named in the LENGTH option (here, LRECL-REC1). In the REWRITE command, you must code a LENGTH option if you want to replace the updated record with a record of a different length.

Table 49 shows the old and new methods of processing BMS maps in the linkage section. In this example, it is assumed that the OS/VS COBOL program has been compiled with the LANGLVL(1) option, and that the following map set has been installed:

MAPSET1 DFHMSD TYPE=DSECT,
               TERM=2780,LANG=COBOL,
               STORAGE=AUTO,
               MODE=IN

The new ADDRESS special register used in the example is described under Using based addressing with COBOL.

Table 49. Addressing BMS map sets in the linkage section
OS/VS COBOL Language Environment conforming COBOL
 WORKING-STORAGE SECTION.
 77 FLD0 PIC X VALUE IS LOW-VALUE.
LINKAGE SECTION.
 01 BLLCELLS.
   02 FILLER PIC S9(8) COMP.
   02 BLL-DATAA PIC S9(8) COMP.
 01 DATA1 COPY MAPSET1.
PROCEDURE DIVISION.
EXEC CICS GETMAIN LENGTH(1000)
     SET(BLL-DATAA)
     INITIMG(FLD0)
     END-EXEC.
WORKING-STORAGE SECTION.
77 FLD0 PIC X VALUE IS LOW-VALUE.
LINKAGE SECTION.
COPY MAPSET1.
01 MAP1
   02 FILLER PIC X(12).
   02 FILLER1L COMP PIC S9(4).
   .
   .
   02 FIELD90 PIC X(20).
PROCEDURE DIVISION
EXEC CICS GETMAIN
     FLENGTH(LENGTH OF MAP1I)
     SET(ADDRESS OF MAP1I)
     INITIMG(FLD0)
     END-EXEC.

The highlighted material describes the contents of the MAP1I COBOL copybook.

Artificial assignments

Remove artificial assignments from an OCCURS DEPENDING ON object to itself. These are needed in OS/VS COBOL to ensure addressability.

[[ Contents Previous Page | Next Page Index ]]