COBOL programming considerations

Some features of COBOL that are of interest to the CICS programmer are:

With compiler option DATA(24), the WORKING-STORAGE SECTION is allocated below the 16MB line. With compiler option DATA(31), the WORKING-STORAGE SECTION is allocated above the 16MB line.

COBOL programming restrictions

This section describes COBOL language elements that you cannot use under CICS, or whose use is restricted or can cause problems under CICS.

By default, the CICS® translator and the COBOL compiler do not detect the use of COBOL words affected by the restrictions listed here. The use of a restricted word in a CICS environment may cause a failure at execution time. However, COBOL provides a reserved-word table, IGYCCICS, for CICS application programs. If you specify the compiler option WORD(CICS), the compiler uses IGYCCICS, and COBOL words that are not supported under CICS are flagged by the compiler with an error message. (The COBOL words normally restricted by the default IBM-supplied reserved-word table are also flagged.) See the Enterprise COBOL for z/OS®: Programming Guide for a current listing of the words which are restricted by IGYCCICS.

The following restrictions apply to a COBOL program that is to be used as a CICS application program. (See the appropriate COBOL programming guide for more information about these functions.)

Language Environment CBLPSHPOP option

The CBLPSHPOP runtime option controls whether Language Environment automatically issues an EXEC CICS PUSH HANDLE command during initialization and an EXEC CICS POP HANDLE command during termination whenever a COBOL subroutine is called.

If your application makes many COBOL subroutine CALLs under CICS, performance is better with CBLPSHPOP(OFF) than with CBLPSHPOP(ON). You can set CBLPSHPOP on an individual transaction basis by using CEEUOPT, as explained in Defining runtime options for Language Environment. However, because condition handling has not been stacked, be aware that:

Using the DL/I CALL interface

If you have programs that use CALL DL/I, and you have not yet made the following changes to them, you should now do so:

Figure 1 illustrates the whole of the above process. The example in the figure assumes that you have three PCBs defined in the PSB and want to use the second PCB in the database CALL. Therefore, when setting up the ADDRESS special register of the LINKAGE SECTION group item PCB, the program uses 2 to index the working-storage table, PCB-ADDRESS-LIST. To use the nth PCB, you use the number n to index PCB-ADDRESS-LIST.

Figure 1. Using the DL/I CALL interface
WORKING-STORAGE SECTION.
    77 PCB-CALL              PIC X(4) VALUE 'PCB '.
    77 GET-HOLD-UNIQUE       PIC X(4) VALUE 'GHU '.
    77 PSB-NAME              PIC X(8) VALUE 'CBLPSB'.
    77 SSA1                  PIC X(40) VALUE SPACES.
    01 DLI-IO-AREA.
       02 DLI-IO-AREA1       PIC X(99).
*
LINKAGE SECTION.
    COPY DLIUIB.
    01 OVERLAY-DLIUIB REDEFINES DLIUIB.
       02  PCBADDR           USAGE IS POINTER.
       02  FILLER            PIC XX.
    01 PCB-ADDR-LIST.
       02  PCB-ADDRESS-LIST  USAGE IS POINTER
                             OCCURS 10 TIMES.
    01 PCB.
       02 PCB-DBD-NAME       PIC X(8).
       02 PCB-SEG-LEVEL      PIC XX.
       02 PCB-STATUS-CODE    PIC XX.
*
PROCEDURE DIVISION.
*SCHEDULE THE PSB AND ADDRESS THE UIB
    CALL 'CBLTDLI' USING PCB-CALL PSB-NAME ADDRESS OF DLIUIB.
*
*MOVE VALUE OF UIBPCBAL, ADDRESS OF PCB ADDRESS LIST (HELD IN UIB)
*(REDEFINED AS PCBADDR, A POINTER VARIABLE), TO
*ADDRESS SPECIAL REGISTER OF PCB-ADDR-LIST TO PCBADDR.
    SET ADDRESS OF PCB-ADDR-LIST TO PCBADDR.
*MOVE VALUE OF SECOND ITEM IN PCB-ADDRESS-LIST TO ADDRESS SPECIAL
*REGISTER OF PCB, DEFINED IN LINKAGE SECTION.
    SET ADDRESS OF PCB TO PCB-ADDRESS-LIST(2).
*PERFORM DATABASE CALLS ......
    ........
    MOVE ........ TO SSA1.
    CALL 'CBLTDLI' USING GET-HOLD-UNIQUE PCB DLI-IO-AREA SSA1.
*CHECK SUCCESS OF CALLS .......
    IF UIBFCTR IS NOT EQUAL LOW-VALUES THEN
                                         ...... error diagnostic code
    ........
    IF PCB-STATUS-CODE IS NOT EQUAL SPACES THEN
                                         ...... error diagnostic code
    ........
[[ Contents Previous Page | Next Page Index ]]