Page 1 of 1

get return code based on value of symbolic parm

PostPosted: Tue Nov 13, 2012 2:28 pm
by rahul2005
Hi,

My requirement is that , I have a JCL in which a variable is defined as
// SET VAR1=N0123456

Value of VAR1 is changing in every run of the job and it is always like N-------- or T-------

now i want to run some steps in this same JCL based on the value of VAR1 ,for example:- STEP3 will run if VAR1 has a value N------- and STEP4 will run if VAR1 has a value T------- .

somehow I want to set return code based on the above two conditions of VAR1 so that I can put COND on STEP3 and STEP4.

Can this be done in JCL? Maybe I can code REXX in a step to check value of VAR1 and get return code from that, but I dont know how, can you please show me a way through.

Re: get return code based on value of symbolic parm

PostPosted: Tue Nov 13, 2012 3:01 pm
by BillyBoyo
So know any Cobol? It is very simple to give your symbolic on a PARM to a Cobol program and for that program to test it and set the RETURN-CODE in the Cobol program, so it can be used in condition-code checking in the JCL.

Re: get return code based on value of symbolic parm

PostPosted: Wed Nov 14, 2012 2:50 am
by NicC
and if you code it properly you can use it for testing new JCL any old time - a bit like an IEFBR14 that takes a parm and does nothing but but give an RC of 0 to whatever and even do an abend.