View previous topic :: View next topic
|
Author |
Message |
@shim
New User

Joined: 28 Oct 2021 Posts: 12 Location: India
|
|
|
|
Hello,
I am invoking a REXX exec through a COBOL program via IRXJCL. In the REXX exec, I have the following CALL coded to run MYPGM.
Every time, the exec gets invoked, the MYPGM gets loaded from STEPLIB. Is there a way, that MYPGM will get Loaded ONCE and for the sub sequent calls it will use the already loaded module. If you could provide any direction or suggestions that would be of great help. Thank you in advance. Please note that I have to keep this chain as it is as part of an existing application COBOL --> IRXJCL --> REXX EXEC
"CALL *(MYPGM)" parm |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1353 Location: Bamberg, Germany
|
|
|
|
Ask your Sysprogs if there's any chance to put your MYPGM into LLA. |
|
Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2600 Location: Silicon Valley
|
|
|
|
I do not know what you need to do from Cobol, but MYPGM needs to be written to be reentrant. And needs to be link-edited to be reentrant (and maybe reusable) so that the system can know that it does not need to load a new copy.
And it probably needs those attributes to be in LLA. |
|
Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
If MYPGM is assembler and reentrant, or at least serially reusable, then there is a technique with which the program can load itself and so bump the use count, which will make the module stay in storage. I have a macro for that.
Or you could copy the module to a VIO dataset and put that in STEPLIB, which will speed up load. |
|
Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2600 Location: Silicon Valley
|
|
|
|
re: program can load itself
Brilliant! |
|
Back to top |
|
 |
@shim
New User

Joined: 28 Oct 2021 Posts: 12 Location: India
|
|
|
|
Thank you Joerg, Pedro & Willy for your response. Yes the module is Reentrant. I am checking with system people if it can be put in LLA.
This is for my understanding, whenever the CALL gets executed in REXX, by default after the CALL the module will be deleted from the storage? In this application, I have one assembler module which gets invoked at the start, if I do a just LOAD EP=MYPGM, can MYPGM be still there in the memory, when the REXX will get control not sure how it will know as we are not passing any load-point address to REXX.
Code: |
"ADDRESS TSO"
"CALL *(MYPGM)" parm |
Thank you !! |
|
Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
Yes, when a CALL has finished then the module will be gone. It is my understanding that modules are ATTACHed. If running authorized then you can do an ATTACH for the jobstep TCB, but that has other implications, not least the authorization issue. A while back I did look briefly at preloading modules, but could not find an easy solution, so dropped the idea. Would love to hear about a possible solution, though. |
|
Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 743 Location: Denmark
|
|
|
|
Should have said 'when a CALL has finished and the module is not in the LPA'. Remember that modules in linklist still have to be located and loaded, though they will benefit from LLA caching, if LLA is active. Only LPA modules are truly resident. |
|
Back to top |
|
 |
|