COND=

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
pat
Member
Posts: 3
Joined: Mon Apr 27, 2009 10:31 pm

COND=

Post by pat » Mon Apr 27, 2009 11:11 pm

In my JCL, there are several steps. Let's say step001, step002, step003, and step004.

I would like to execute step003 only if step002 abended. What condition should I check? I tried COND=((0,EQ,STEP002),ONLY), but if step001 abended, this step will execute, please help.

Thanks in advance.
Pat

maheshvamsi
Active Member
Posts: 52
Joined: Wed Mar 25, 2009 11:56 pm
Location: Banglore

Post by maheshvamsi » Mon Apr 27, 2009 11:21 pm

I think, we can't handle abends in JCL.

we can execute some steps, if above step fails with some retrun code instead of abends(soc7/soc4.. etc).
Thanks

MaheshVamsi

pat
Member
Posts: 3
Joined: Mon Apr 27, 2009 10:31 pm

Post by pat » Mon Apr 27, 2009 11:28 pm

How would I code the JCL if step002 returns SOC7?

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Tue Apr 28, 2009 12:00 am

Pat,

What maheshvamsi said is true.

If a step ABnormally ENDs, the job stops.

by the way, a S0C7 is not a step return code. It is an MVS run-time error.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Tue Apr 28, 2009 1:08 pm

Pat,

Refer chapter-10 in jcl tutorial.
http://www.mainframegurukul.com/srcsinc ... l/jcl.html
Natarajan
Chennai

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Tue Apr 28, 2009 1:35 pm

I stand corrected.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Apr 28, 2009 5:50 pm

like to execute step003 only if step002 abended
You can execute step003 based on some value of the RC of step002 - as other suggested once there is an abend, your job is actually (abnormally) terminated.
Regards,
Anuj

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others