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
 

 

External Storage in Assembler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: External Storage in Assembler
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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Mar 26, 2010 3:46 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Mar 26, 2010 3:57 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Mar 26, 2010 4:11 pm    Post subject: Reply to: External Storage in Assembler
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    Post subject:
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: 7931
Location: Bellevue, IA

PostPosted: Fri Mar 26, 2010 4:48 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Mar 26, 2010 4:51 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Mar 26, 2010 5:24 pm    Post subject:
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

Site Director


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

PostPosted: Fri Mar 26, 2010 8:46 pm    Post subject:
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    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 A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts Online Assembler Program Starting point Aditya.Srivastava PL/I & Assembler 4 Fri Jul 08, 2016 6:48 pm
No new posts Compiler option for override the exte... muralikrishnan_new COBOL Programming 9 Fri Jul 08, 2016 12:09 pm
No new posts How storage is calculated for AN-Edit... Raghu navaikulam COBOL Programming 2 Wed Mar 09, 2016 3:51 pm
No new posts How can amount of the Storage Usage b... esduman61 CICS 6 Wed Mar 09, 2016 1:19 pm


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