View previous topic :: View next topic
|
Author |
Message |
Avinashhlg
New User
Joined: 05 Jan 2010 Posts: 7 Location: Bangalore
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Avinashhlg
New User
Joined: 05 Jan 2010 Posts: 7 Location: Bangalore
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Have you tried this? What happened when you did? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|