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

Return code from JCL to Program


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
aripallig

New User


Joined: 05 Jul 2005
Posts: 23
Location: india

PostPosted: Wed Sep 08, 2010 8:35 am
Reply with quote

Hi All,
here i have doubt in JCL,

Step1 is going to return the return code which i am not sure what it is going to give.

But in step2 i need to read the return code of the step1 and need to pass that value to the cobol pgm which is in the next step and need to run the Step2.

Could some one help me how we can pass the return code of the JCL to the Application program.

Thanks,
Girish A
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 Sep 08, 2010 8:46 am
Reply with quote

Hello,

Quote:
But in step2 i need to read the return code of the step1 and need to pass that value to the cobol pgm
A redesign is needed. . .

What is step1?

JCL can act on the condition code set by a prior step, but it is not available to an applicaton program.
Back to top
View user's profile Send private message
aripallig

New User


Joined: 05 Jul 2005
Posts: 23
Location: india

PostPosted: Wed Sep 08, 2010 9:25 am
Reply with quote

Hi Dick,

Thanks for your information, i had this as an interview question.

They asked me if we can pass the return code from previous step of the JCL to Program of the next step. so that based on the return code we need to execute the step2.

Thanks,
Girish A
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 Sep 08, 2010 9:38 am
Reply with quote

Hello,

I believe you misunderstood the queston. . .

Quote:
so that based on the return code we need to execute the step2.
This is the normal way to use a condition code.

It has nothing to do with getting the return code into the program. The condition code test is coded in the jcl and will control execution of a cobol program or a utility program (anything that is executed by PGM=).

You need to understand that this is a function of jcl rather than code.

At the top of the page is a link to "IBM Manuals" where you will find the JCL Language RFeference. Suggest you read the complete info about COND.
Back to top
View user's profile Send private message
aripallig

New User


Joined: 05 Jul 2005
Posts: 23
Location: india

PostPosted: Wed Sep 08, 2010 1:43 pm
Reply with quote

Hi Dick,

Thanks for your time in providing me the reply.

Thanks,
Girish A
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 Sep 08, 2010 7:13 pm
Reply with quote

You're welcome - good luck icon_smile.gif

d
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Sep 09, 2010 4:50 pm
Reply with quote

aripallig wrote:
Step1 is going to return the return code which i am not sure what it is going to give.

But in step2 i need to read the return code of the step1 and need to pass that value to the cobol pgm which is in the next step and need to run the Step2.
Probably, you can write a REXX to capture the RC of Step1. Write that in a file and read this file in your COBOL-program?
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: Thu Sep 09, 2010 7:52 pm
Reply with quote

Hi Anuj,

Why even attempt this if all that is needed is conditional execution of step2?

We probably need a better definition of what is really wanted. . .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 8:17 pm
Reply with quote

could you not use some IF/THEN/ELSE/END-IF constructs
to SET a symbolic
which would be a 'parm' for the COBOL program?

or can you not SET symbolics during the execution of a JOB?
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top