Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
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
 
Return code from JCL to Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Return code from JCL to Program
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

Site Director


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

PostPosted: Wed Sep 08, 2010 8:46 am    Post subject:
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    Post subject: Thanks note to dick
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

Site Director


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

PostPosted: Wed Sep 08, 2010 9:38 am    Post subject:
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    Post subject: Thanks note to Dick
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

Site Director


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

PostPosted: Wed Sep 08, 2010 7:13 pm    Post subject: Reply to: Return code from JCL to Program
Reply with quote

You're welcome - good luck icon_smile.gif

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

Senior Member


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

PostPosted: Thu Sep 09, 2010 4:50 pm    Post subject: Re: Return code from JCL to Program
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

Site Director


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

PostPosted: Thu Sep 09, 2010 7:52 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Sep 09, 2010 8:17 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
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

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us