Page 1 of 1

Read 'ReturnCode' from a dataset

PostPosted: Thu Mar 28, 2013 8:53 am
by ghosts
Hi,

Description:
I have a job which executes an CICS online program (by a transaction call) and the program puts a code into a PS file.

My challenge:
I want to evaluate the code from previous step (CICS output PS file) and only then execute the next steps in JCL

I hope I put it in a understandable way.

Additional info:
//step01....
//.....
//...
//step05 Execute an online PGM and this puts a code in a PS 'file01'
//*
//step06 evaluate the 'file01' and then execute below steps
//step07.........
//step08.........
//

Re: Read 'ReturnCode' from a dataset

PostPosted: Thu Mar 28, 2013 12:53 pm
by BillyBoyo
Well, if I've understood what you want, and what you've done, and the first part is working, then have a new program which reads the PS file, looks at the value, then sets RETURN-CODE (a Cobol Special Register) to an appropriate value. When your program ends, the RETURN-CODE value will be the Condition Code value for the step, which you can test in a subsequent step.

Re: Read 'ReturnCode' from a dataset

PostPosted: Thu Mar 28, 2013 7:04 pm
by dick scherrer
Hello,

There may (will?) be a problem when the online and the batch both try to get exclussive control of the PS file . . .

Re: Read 'ReturnCode' from a dataset

PostPosted: Thu Mar 28, 2013 7:55 pm
by Monitor
The PS-file in CICS is a TD Extra Destination, which can be closed by EXEC CICS SET TDQUEUE() CLOSED before the CICS transaction ends.

Re: Read 'ReturnCode' from a dataset

PostPosted: Thu Mar 28, 2013 9:39 pm
by dick scherrer
Hello,

If the batch job specifies OLD, will there not be a problem when CICS tries top open the file for update?