Invocation of CICS Programs to Access DB2

You can write programs in COBOL, PLI, C, and Assembler to access DB2. For Substation ES to execute these programs, they must be able to take input and deliver output in one of following ways:

  • COMMAREA: data is presented to the program in COMMAREA. Upon return from the program, the content of COMMAREA is considered the output of the program and is sent back to Substation ES.

    The maximum input and output length of the COMMAREA is 32,000 characters.

  • Container: data is presented to the program in CICS Container whose name is the same as the program name. The program returns its response in the same Container. In the absence of response from the user program, the program deletes the Container. Upon return from the program, the content of the Container is returned to Substation ES. If no Container is found, the response is No Response.

    A Container can be any length. A container size is constrained only by the available user storage in the CICS address space.

  • TSQ name in COMMAREA: data is presented to the program in CICSTSQ. The eight-character TSQ name is in COMMAREA. The program reads the TSQ to obtain input. Output from the program is placed in the same TSQ. Upon program return, the content of the TSQ is used by Substation ES as the response. If the TSQ is not found, then a NULL response is returned.

    The size of input and output data is only limited by TSQ constraints and storage to support the size of the TSQ.

  • Storage pointer in COMMAREA: data is presented to the program as a pointer to a storage area and length. Those two fields are in the COMMAREA. The program can access the storage directly. Upon return from the user program, the content of the storage area is used by Substation ES as the response.