Page 1 of 1

OPC SCAN SETVAR

PostPosted: Fri Jan 22, 2010 6:30 pm
by jmartind
Please, I am trying to use an OPC variable for the return code of a JCL and I am not able to find it.
Could you help me to find it?

I send you an example of my JCL , but my Temp Variable doesn't works
The variable TRC is defined in TWS as default value = 0, but always give as result 12.

//CADENAY JOB ('ACCOUNT INFO'),'SISTEMAS',
// CLASS=X,MSGCLASS=X,
// COND=(90,EQ)
//*%OPC SCAN
//PASO002 EXEC PGM=IKJEFT01,PARM='%CODE 90'
//EXEC DD DISP=SHR,DSN=FERRONA.ISPEXEC
//SYSTSPRT DD DUMMY
//SYSTSIN DD DUMMY
//*%OPC SETVAR TRC=90

The other JCL is:

//CADENAYY JOB ('ACCOUNT INFO'),'SISTEMAS',
// CLASS=A,MSGCLASS=X
//*%OPC SCAN
IF TRC = 90 THEN GOTO PASO0010 ELSE EXIT 69
LABEL PASO0010
//PASO0010 EXEC PGM=IEFBR14
//DD1 DD DUMMY

This JCL cancel with misplaced DD in the IF line

Thank you very much.

Re: OPC SCAN SETVAR

PostPosted: Sat Jan 23, 2010 12:34 am
by dick scherrer
Hello and welcome to the forum,

The problem is not really a misplaced DD. The problem is that the IF statement is wrong.

This is the Table of Contents for the JCL Reference manual:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0/CONTENTS

Suggest you review how IF/THEN/ELSE is coded. . .

Also, suggest you bookmark that page (and download a copy locally) as the JCL Reference is something that is very often used.

Re: OPC SCAN SETVAR

PostPosted: Tue Jan 26, 2010 10:27 pm
by jmartind
Thank you very much.
I will try it with the information you sent to me, and hope it'll works ok soon.

Re: OPC SCAN SETVAR

PostPosted: Wed Jan 27, 2010 1:47 am
by dick scherrer
You're welcome :)

Someone will be here if there are questions or problems.

Re: OPC SCAN SETVAR

PostPosted: Tue Feb 02, 2010 5:05 pm
by jmartind
Hello again,
I tried it, but I'm not sure that the problem is a sintaxis with the IF/THEN/ELSE.
After review some OPC manuals and the JCL Reference manual you sent to me ,I have seen that the sintax is different if I use the Conditional expression with OPC SCAN IF/THEN/ELSE command or with the //IF command of the JCL. but I couldn't find an example of how code an IF/THEN/ELSE with OPC using variables.
Has anybody an example?

Thank you very much!