Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Abend step not running as per the requirement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 69
Location: India

PostPosted: Fri Apr 11, 2014 4:20 pm    Post subject: Abend step not running as per the requirement
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: 69
Location: India

PostPosted: Fri Apr 11, 2014 4:55 pm    Post subject:
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: 1278
Location: Belgium

PostPosted: Fri Apr 11, 2014 4:56 pm    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Fri Apr 11, 2014 5:00 pm    Post subject:
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: 69
Location: India

PostPosted: Fri Apr 11, 2014 5:46 pm    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Fri Apr 11, 2014 6:36 pm    Post subject:
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: 1715
Location: UK

PostPosted: Fri Apr 11, 2014 8:20 pm    Post subject: Reply to: Abend step not running as per the requirement
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us