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 Profile Log in to check your private messages Log in
 
Confusion b/w RC and Condition code

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

New User


Joined: 04 Oct 2006
Posts: 10
Location: Pune

PostPosted: Tue Jan 23, 2007 3:08 pm    Post subject: Confusion b/w RC and Condition code
Reply with quote

I have the following scenario

//job1 JOB 'account info'
//step1 exec pgm=idcams
// delete some files
//step2 exec pgm=cob123,cond(0,LT)
// some dd statement
//step3 exec pgm=icetool,cond(0,LT)
// does some sorting
//step4 exec pgm=cob345,cond(0,LT)
// some dd statements
//step5 exec pgm=icetool,cond(0,LT)
// does some sorting
// IF(RC GE 8) THEN
//step6 exec pgm=FTP
// dd statement
// ENDIF
//step7 exec pgm=idcams
// delete some files
// IF(RC LE 8) THEN
//step8 exec pgm=FTP
// dd statement
// ENDIF
//

In which senarios step6, step7 and step8 will execute? Is previous RC gets overwriiten every time next step executes?
For example
1. step1 executed successfully. Is idcam sets RC?
2. step2 executed successfully Program sets RC to 0
3. step3 failed Is icetool sets RC?


What would be the final RC?

What is the difference between RC and Condition code and MAXCC?
Back to top
View user's profile Send private message

prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Tue Jan 23, 2007 3:57 pm    Post subject:
Reply with quote

Hi Amit,
In JCL for each and every step execution you would get an Return Code say for example u have 3 stpes Step1 Step2 and Step3, for example consider the foll.
Step1 executes with a RC of 0
Step2 Executes with a RC of 4
Step3 Executes with a RC of 8 your RC for the STEP1 would be 0and Step2 would be 4 and RC for step3 would be 8 . MAXCC is the max value of these three steps typically would be 8, bcos Step3 RC iss greater than STEP1 and 2 RC so MAXCC would be 8. Hope this clears diff b/w MAXCC and RC. Now coming to your next query, in your example before step6 u have given a condition
IF(RC GE 8) THEN
This would consider the previous step return code i.e.. step5 ka RC and if and only if it is GT 8 it would execute Step6 and for setp7 there is no condition code being checked so this would execute normally and step7 has its own RC adn Step8 will only execute if step7's RC is LT 8

Hope u got what u were looking for .. let me know if u have further concerns.

Cheer's,

Thamilzan.
Back to top
View user's profile Send private message
amitkoshti
Warnings : 1

New User


Joined: 04 Oct 2006
Posts: 10
Location: Pune

PostPosted: Tue Jan 23, 2007 4:56 pm    Post subject: Re: Confusion b/w RC and Condition code
Reply with quote

Thanx for resolution.
I still have one doubt.
Consider step2 failed. what will happen in this case? Which step will be executed?
Back to top
View user's profile Send private message
amitkoshti
Warnings : 1

New User


Joined: 04 Oct 2006
Posts: 10
Location: Pune

PostPosted: Tue Jan 23, 2007 5:21 pm    Post subject: Re: Confusion b/w RC and Condition code
Reply with quote

[quote="amitkoshti"]Thanx for resolution.
I still have one doubt.
Consider step2 failed. what will happen in this case? Which step will be executed?

Consider the following senarios
1) Step2 returned with RC code 9
2) Step2 returned with RC code 3

What will happen in these 2 scenarios.

Also want to know that utilities like IDCAMS, ICETOOL, SORT sets the RC or not?

What is difference between RC and Condition code used in COND(0,LT)?

Please reply
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jan 24, 2007 4:44 am    Post subject:
Reply with quote

Hello,

RC (Return Code) and CC (Condition Code) are the same thing.

Basically, ALL utilities may set an RC/CC. It is up to you to determine which are "fatal" to your job and which are acceptable.

To answer your questions on what will happen if the RC is various values, write a small program that will accept a parm or read a control statement and set RETURN-CODE. You will be able to test every situation that you are interested in. You could run the program multiple times in the same job to set different RCs for testing multiples.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Wed Jan 24, 2007 11:22 am    Post subject:
Reply with quote

Quote:
Consider the following senarios
1) Step2 returned with RC code 9
2) Step2 returned with RC code 3


Amit if your step2 failed with RC 9 Step # 3,4 and 5 wont be exercuted due to the condition code's that u have written however step 6 and 7 will execute and step 8 won't due to the if cond. u have coded..


Coming to the second senario if RC=3 for the step #2

due to the cond code coded i your step # 3,4 and 5 these steps wont execute and step 6 will also not be executed , step 7 and 8 would execute as theere is no cond coded for 7 and the cond code coded in step 8 is satisfied

and the answer for your question for setting RC by utilities yes it is possible
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 BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am

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