Compiling and Debugging a CICS Program

Question: How do I compile a CICS online program? What is the procedure for debugging a CICS program? What steps should we follow after coding?

Answer: The DFHEITCL procedure is the easiest way to do this as it contains the translate, compile and link edit steps that you need. The job to run this proc will look something like this for MVS (substitute your values for the items in lowercase):

//jobname JOB (accounting-info)
//TRN.SYSIN DD DDNAME=source.library(member),DISP=SHR
//           DD DSNAME=copy.library,DISP=SHR
NAME member (R)

If you are using BMS to define your CICS maps then you'll need to process that too with a job like the following:

//jobname JOB (accounting-info)
//S1      EXEC DFHMAPS,MAPNAME=mapname,
//         MAPLIB=map.load.library
//COPY.SYSUT1 DD DSNAME=map.source.library(member),DISP=SHR

You should process and test your maps first before using them in your program.

To debug your CICS program you can use the CEDF (execution diagnostic facility) command within CICS. This can be run either in single screen or dual screen mode, it's easier with two screens. This will interrupt the execution of your CICS program every time that the program executes a CICS command to let you know which command is being executed. You can also examine all of the values stored in memory at each of these points (using F5).

An easier way to test your CICS programs is to use one of the third party programs that have been developed for this purpose. They allow you to set break points wherever you need them in your code not at every CICS command like CEDF does. My favourite third party CICS debugging program is Xpediter.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow