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 Usergroups Profile Log in to check your private messages Log in
 

 

Get a return code of previous step / Assembler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Pierre Lemieux

New User


Joined: 17 May 2007
Posts: 1
Location: Qu?bec

PostPosted: Fri May 18, 2007 6:30 pm    Post subject: Get a return code of previous step / Assembler
Reply with quote

Hi!
I execute a batch job with 2 steps. Step 1 produce any return code.
How to read this return code in the Step2.

Step2 is an assembler program that should be able to read the previous step without having to mention the previous step's name.

Is this possible ? If so how ?

Thanks !
Back to top
View user's profile Send private message

UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Tue May 22, 2007 4:26 pm    Post subject:
Reply with quote

Hi Pierre !

...that should be able to read the previous step without having to mention the previous step's name.

Do you really believe that ??? Why ???

As an old assembler programmer, I can tell you how to get all the information of the TCB, ACB or the TIOT during runtime in an Ass-Pgm.
Or how to modify the JobFileControlblock or something else. But these are all informations during actual runtime. I actually have no idea of getting the rc of a previous already ended step. Without reading SMF-Records.

In fact of having to do this, i would transfer the rc via a temporary dataset between these programms. Quiet simple an easy.

Please let me know, if you have any solution for an ass-pgm.

Regards, UmeySan
Back to top
View user's profile Send private message
ganeshptrk

New User


Joined: 04 Apr 2007
Posts: 17
Location: Chennai

PostPosted: Mon Jun 25, 2007 7:44 pm    Post subject: Re: Get a return code of previous step / Assembler
Reply with quote

The return code set by step1 is stored in R15. In your assembler program verify the contents of R15.
If fact, at end of Assembler program, just before exiting, we set the return code in R15 and return to address specified in R14.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 25, 2007 8:16 pm    Post subject: Re: Get a return code of previous step / Assembler
Reply with quote

ganeshptrk wrote:
The return code set by step1 is stored in R15. In your assembler program verify the contents of R15.
If fact, at end of Assembler program, just before exiting, we set the return code in R15 and return to address specified in R14.


And what makes you think that nothing else happens between the end of one step and the beginning of the next.
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: Mon Jun 25, 2007 9:07 pm    Post subject:
Reply with quote

Hello,

If you find a way to retrieve the rc you want, how will it be used?

As UmeySan posted, this is not a typical requirement.

If you describe what functionality you need to solve some business requirement, we can probably offer suggestions.

If you are determined to find exactly this, be prepared to do a lot of digging (unless some kind soul happens to have and will post the code here). The info is in the system (as this is how condition code testing is supported), but if i recall, it is not as simple as looking into control blocks of the currently executing step.

As i mentioned, if you describe your requirement (other than the retrieving of a prior step's rc), we may be able to offer suggestions.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Mon Jun 25, 2007 9:31 pm    Post subject:
Reply with quote

There must be something out there capable of doing so. How else would the COND parameter be able do decide to execute the next step or not?
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: Mon Jun 25, 2007 9:38 pm    Post subject:
Reply with quote

Hello,

Yes, it is in the system (once upon a time, in a much earlier version of the operating system (before it was re-named to MVS), i chased down similar info, but it was so long ago that the specifics have left my mind. . . icon_confused.gif ).

As it would be a rare requirement, i don't know if anyone will have code to do this that is not proprietary. We'll see icon_smile.gif
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 743
Location: Germany

PostPosted: Thu Jun 28, 2007 1:18 pm    Post subject:
Reply with quote

Hi !

@ganeshptrk:

Yes, you could set R15 for Rc. But allways your applikation-programm
runs as a sub-programm under control of the system. So only the System can interpret this rc and initiate something.

@Craq Giegerich:

Right man! There's happening al lot of things!!!

@Dick & Bitneuker:

Yes, there is something. The JES-Routines and Services. And all these fucking control-blocks. If one has time enought, he could spend it in analysing how the IF-THEN-ELSE construct in the JCL is been realized.

As i worked in an RACF projekt, we had to analyse and modify RACF control-blocks and write exits and so on, depending on interactive system events. Terrible and nerve-racking work. Cost's me some brain cells and a lot of bucks for red wine.

@All:

So why not using this services. Just add al little IF construction in the
JCL. IF previous Steps ends with RC=0 execute next pgm with PARM=OK,
else execute next pgm with PARM=NO. Then interpret the parm in the applikation an do something you want.

I think, we need no doctoral dissertations. What we really need are practicable and efficient solutions. But also simply created, that everyone of us could understand what another guy had done there. And this also just in the middle of the night after two bottles of red wine and an exhausting hour with two blonds.

We don't get an iron cross ore a medal of honour for a high sophisticated
solution. So if your are only a applikation programmer, need the tools, which are allready there.

Regards & nice weekend
UmeySan
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 -> PL/I & Assembler 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 Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am


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