condition code in jcl



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

condition code in jcl

Postby arya_starc » Sat May 07, 2016 5:58 pm


//testjob jcl  msgclass=x,class=w
//step1 exec pgm=sort,cond(0,ne)
//...
//...
//step2 exec pgm=idcms,cond(4,ne)
//...
//...
 

If the step1 return code cam as 4 then step 2 should be executed but in my case it is getting skip and showing flush in the spool.
Kindly correct me if i am wrong
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: condition code in jcl

Postby Aki88 » Sat May 07, 2016 6:50 pm

Hello,

Are you sure the JCL shown by you here doesn't fail with 'JCL Error'?

Also:
a. Can you please show us the JESMSGLG where the step shows as flushed.
b. In conjunction to this, please confirm if the IEFBR14 step in question is the immediate step after your SORT step.
c. Lastly and most importantly please confirm the RC of the SORT step.
Aki88
 
Posts: 381
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 36 times

Re: condition code in jcl

Postby steve-myers » Sat May 07, 2016 7:39 pm

As aki88 noted the topic starter's JCL will not run. Ever. Period. Full stop. End of story.

I prepared and ran this JCL, with a proper JOB statement, of course. The SETCC program just returns with a return code equal to the contents of the PARM. It's a useful tool to check things like this.
//JOBLIB   DD  DISP=(SHR,PASS),DSN=&SYSUID..LOAD
//A       EXEC PGM=SETCC,PARM=4,COND=(0,NE)    
//B       EXEC PGM=SETCC,PARM=0,COND=(4,NE)

The first step ran, of course, and finished, as expected, with RC = 4.

IEF142I XXXXXXX A - STEP WAS EXECUTED - COND CODE 0004

The second step also ran, and finished with RC = 0.

IEF142I XXXXXXX B - STEP WAS EXECUTED - COND CODE 0000
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: condition code in jcl

Postby willy jensen » Sun May 08, 2016 12:50 am

You really need to look at the JCL manual for condition code checking, it iscounter-intuitive.

cond(4,ne) means bypass this step if max cond != 4
and as maxcc so far is 4 it means that step 2 will run.

I'd like to do nasty things to whomever designed the condition code checker.
My recommendation is to use the IF/END JCL statement.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: condition code in jcl

Postby prino » Sun May 08, 2016 2:46 pm

I'd like

  • to see this thread moved to the correct forum, and
  • closed
as a simple lookup in the manuals would have told the TS everything he needs to know!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: condition code in jcl

Postby enrico-sorichetti » Sun May 08, 2016 4:57 pm

moved and locked !
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post