CICS programs are written in COBOL language in Mainframes. We will be discussing about writing a simple COBOL-CICS program, compiling it, and then executing it.
EXEC CICS function [(option (argument value)] [(option (argument value)] END-EXEC. |
Translate, compile and linkedit a CICS application program into the CICS application program library (LOADLIB).
Define Trans-ID into PCT with associated program name
Define program into PPT
Register Terminal into TCT
Register the user in SNT(Sign-On Table)
Other CICS tables e.g. FCT, JCT, DCT must be prepared for the application programming if required
Sign-On CICS and enter Trans-ID.
In addition to the above basic procedures, the detailed CICS system environment must be prepared properly by the system programmers or application programmers.
The terminal must be registered in the TCT.
The CICS user identifier must be registered in the SNT.
Other CICS tables (viz. FCT, JCT, and DCT) must be prepared for the application program, if required.
Below is a simple COBOL-CICS program which displays message "Welcome to IBMMainframer Community" on the CICS output screen.
IDENTIFICATION DIVISION. PROGRAM-ID. IBMMFPGM. DATA DIVISION. FILE SECTION. WORKING-STORAGE SECTION. 01 WS-DISP-MESSAGE PIC X(40). 01 WS-DISP-LENGTH PIC S9(4) COMP. PROCEDURE DIVISION. 0000-MAIN-PARA. MOVE 'WELCOME TO IBMMAINFRAMER COMMUNITY' TO WS-DISP-MESSAGE MOVE '+34' TO WS-DISP-LENGTH EXEC CICS SEND TEXT FROM (WS-MESSAGE) LENGHT(WS-LENGTH) END-EXEC EXEC CICS RETURN END-EXEC. |
This simple program uses CICS commands SEND TEXT, which is used to sends data without mapping to terminal and RETURN command is used to returns program control.
This sample program uses three basic CICS commands RECEIVE, SEND and RETURN.
This program will
Read a message from the terminal.
Send the message back with acknowledge message.
Terminate the transaction.
Note the error handling part after the EXEC CICS RECEIVE command.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!