IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Abend step not running as per the requirement


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Fri Apr 11, 2014 4:20 pm
Reply with quote

Hi,
I have a JCL which gets the return code of 01 or 02 from the cobol program based on the program logic and if the return code is 01 or 02, the job should abend.

My doubt is that even though i am getting the return code of 2 from rogram the job is not getting abend. Can someone please help me-

JCL-
-----
Code:

//PSTY0010 EXEC PGM=TESTNOFL,COND=(4,LT)
//SYSOUT   DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*
//SORTMSG  DD  SYSOUT=*
//SYSIN    DD  DSN=CPISXK.TEST.SYSIN(CCCHECK),DISP=SHR
//*
//ABEND010 EXEC  PGM=ABEND,
//            COND=(3,GT,PSTY0010)
//*
//* -----------------------------------------------------------------
//* IF JOB FAILS AT THIS STEP, ENGAGE THE ON CALL SUPPORT PERSON
//* -----------------------------------------------------------------
//ABEND011  EXEC  PGM=ABEND,
//         COND=((1,NE,PSTY0010),(2,NE,PSTY0010))
//*


JESMSG
--------
Code:

-JOBNAME  STEPNAME PROCSTEP    RC   EXCP   CONN       TCB
-TESTNOFL PSTY0010             02     67     15       .00
-TESTNOFL ABEND010          FLUSH      0      0       .00
-TESTNOFL ABEND11           FLUSH      0      0       .00


Here setp ABEND11 should run and the job should abend??
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Fri Apr 11, 2014 4:55 pm
Reply with quote

Oh my apology. Actually one of the condition (1,NE,PSTY0010) is true so the condition will be true and the abend step will be bypassed. It has no flaw.

Sorry, my mistake here. icon_cry.gif
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Apr 11, 2014 4:56 pm
Reply with quote

Your condition will always be TRUE
Code:
        (cc NE  1) or (cc NE 2)
CC = 0 =>    TRUE  or    TRUE   => TRUE
CC = 1 =>    FALSE or    TRUE   => TRUE
CC = 2 =>    TRUE  or   FALSE   => TRUE
CC = 3 =>    TRUE  or    TRUE   => TRUE
----------------------------------
         (cc LT 1) or (cc GT 2)
CC = 0 =>    TRUE  or    FALSE  => TRUE
CC = 1 =>    FALSE or    FALSE  => FALSE
CC = 2 =>    FALSE or    FALSE  => FALSE
CC = 3 =>    FALSE or    TRUE   => TRUE
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Apr 11, 2014 5:00 pm
Reply with quote

Note that the z/OS MVS JCL Reference states:
Quote:
If any of the test conditions are satisfied, the system evaluates the COND parameter as true and bypasses the job step

My opinion is that the IF/THEN/ELSE construct is superior to the COND parameter. If you wish to make use of COND, however, code it as
Code:
COND=(0,EQ,PSTY0010)
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Fri Apr 11, 2014 5:46 pm
Reply with quote

Hi Akatsukami,
I also think that IF/THEN/ELSE is a better option than COND but in my organization IF condition is not allowed instead the standard is to follow COND.

And Yes, i later corrected my condition to COND=(0,EQ,PSTY0010) and it worked.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Apr 11, 2014 6:36 pm
Reply with quote

I also prefer the IF/THEN/ELSE construct, but as in sandeep's case IF is not allowed in production JCL here. I've heard that JCLs with IF are more difficult to deal with in case of restarts.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Apr 11, 2014 8:20 pm
Reply with quote

Quote:
I've heard that JCLs with IF are more difficult to deal with in case of restarts

Not if you set the procedures up correctly in the first place. Takes a bit of thinking out but generally restarts can be handled cleanly.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Cobol-db2 : SQL query is running for ... DB2 4
No new posts Execute step regardless of previous s... JCL & VSAM 2
No new posts ABEND=04E FOR REASON=00E50013 DB2 4
No new posts Any idea about how to solve 3022 aben... IMS DB/DC 3
No new posts Handling abend to prevent termination CICS 0
Search our Forums:

Back to Top