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

Get a return code of previous step / Assembler


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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: 771
Location: Germany

PostPosted: Tue May 22, 2007 4:26 pm
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
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
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

Moderator Emeritus


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

PostPosted: Mon Jun 25, 2007 9:07 pm
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: 1104
Location: The Netherlands at Hole 19

PostPosted: Mon Jun 25, 2007 9:31 pm
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

Moderator Emeritus


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

PostPosted: Mon Jun 25, 2007 9:38 pm
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: 771
Location: Germany

PostPosted: Thu Jun 28, 2007 1:18 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top