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

Confusion b/w RC and Condition code


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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

Moderator Emeritus


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

PostPosted: Wed Jan 24, 2007 4:44 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top