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

External Storage in Assembler


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Avinashhlg

New User


Joined: 05 Jan 2010
Posts: 7
Location: Bangalore

PostPosted: Fri Mar 26, 2010 11:07 am
Reply with quote

Hi,

I have a Cobol program calling Assembler program. The assembler program is called multiple times by the Cobol program(called in loop). I need to retain some of the values in assembler program for use the next time I call. Is it possible by any means to save these values in some way so that I can re-use the data in subsequent runs.
Note:- I do not want to send this data back to Cobol calling program. I should use this only in assembler.

Regards,
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Mar 26, 2010 3:46 pm
Reply with quote

A variable defined as DC in an assembler program will retain its value unless the program clears it or the program is reloaded. Of course, where an Assembler program modifies a DC variable, the Assembler program is non-reentrant, if that's a concern.

Garry.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Mar 26, 2010 3:57 pm
Reply with quote

Quote:

so that I can re-use the data in subsequent runs


Means to me start-stop-start-stop of the cobol program. Data wil not
be saved.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Mar 26, 2010 4:11 pm
Reply with quote

What does "Subsequent Runs" mean? If it's "Steps", then this design needs to be reviewed.

If not "Steps" and re-entrancy is desired, then a GETMAIN or STORAGE OBTAIN Macro in the Assembler program is an option.

This sounds like a jigsaw puzzle with missing pieces.

Bill
Back to top
View user's profile Send private message
Avinashhlg

New User


Joined: 05 Jan 2010
Posts: 7
Location: Bangalore

PostPosted: Fri Mar 26, 2010 4:31 pm
Reply with quote

Basically the COBOL program runs only once, during its execution the assembler program is called multiple times. I have a logic in assembler for which i need to retain the values of the variable used in the assembler program. Is it possible to retain the values atleast till the completion of the Cobol program.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 26, 2010 4:48 pm
Reply with quote

Have you tried this? What happened when you did?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Mar 26, 2010 4:51 pm
Reply with quote

That is possible if you use a LOAD macro to obtain the entry point of the
sub program and use that to BALR to the sub program.
I dont think such a construct is possible in Cobol.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Mar 26, 2010 5:24 pm
Reply with quote

If a field is defined as a "constant" in an Assembler program it is part of the program and Assembler can modify it. It will be in 'last-used' state the next time the Assembler program is called in same program unless something causes it to be reloaded. Have the Assembler program statically called so that it forms part of the Cobol load module and there's no reason why the program should be reloaded.
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: Fri Mar 26, 2010 8:46 pm
Reply with quote

Hello,

Quote:
I do not want to send this data back to Cobol calling program. I should use this only in assembler.
Why? Other than someone's preference?

Suggest you consider defining the variable(s) in the cobol code and include this in the USING parameter list. It will take the same amount of memory and make life much easier - there would never be a concern of the contents.
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 CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts CICS vs LE: STORAGE option CICS 0
No new posts Insufficient Storage ABENDS & Debugging 7
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
Search our Forums:

Back to Top