Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting the Calls through compile JCL

Status
Not open for further replies.

ramanaefds

Programmer
Dec 9, 2002
6
IN
Hi,

1)Suppose Program A calls Program B through static call,I can convert this to dynamic thur compile jcl option DYNAM. So During run time I have to supply the load module of the program B. Please let me know if this statement is wrong.

2) Suppose Program A calls Program B thru Dynamically, Can I convert this to static call through compile jcl option 'NODYNAM' and in addition to this shall I need to linkedited the Program B loadmodule with the mainprogram loadmodule program A????

Please clarify my above two points.

Thanks
Ramana Murthy P.V.

 
Hi R,

If you use the NODYNAM compiler option, you can CALL a subpgm either dynamically or statically using the following in the CALLing pgm:

dynamic - CALL identifier e.g. CALL WS-SUBPGM
static - CALL 'literal' e.g. CALL 'PGMA'

WS-SUBPGM can be predefined with the pgmname or it can be filled via a MOVE stmt prior to execution of the CALL.

If, on the other hand, you have a pgm or group of pgms that use the CALL 'literal' approach and you want to change them to DYNAMIC CALLS, you can optionally recompile and relink them with DYNAM and not change the code.

Re. your 2nd ques:

When doing dynamic calls, make sure the subpgms have been compiled & linked before you EXECUTE the mainline pgm.

When doing static calls, make sure the subpgms have been compiled & linked before you LINKEDIT the mainline pgm.

HTH, Jack.
 
Jack -

This is just curiosity, but I want to know more about your last statement "compiled & linked before you LINKEDIT". It's been a while since I did OS/390 (or whatever the nom de jour is) and I don't remember how things work.

In the VSE environment, object code written by the compiler is placed in the SYSLNK file if it is to be linked as a phase (load module). This would be appropriate for a main program or a dynamic subprogram. Statically called modules must be compiled with the DECK option and the object code cataloged to an object code library (VSE PDS). That is because static calls must be resolved by the linkage editor and the VSE linkage editor expects to find those modules in the object code library, not in a phase library.

Is that distinction lost in the OS/390 world, or does the linkage editor simply make that transparent to the programmer, or ????

Thanks.

Glenn
 
Hi Glenn,

Good catch. The subpgm needs only to be compiled and then it's object code is combined with the the mainline module and linked. I always use a compile and link proc when I prepare a module for processing, so I mistakenly used the wrong nomenclature. Sorry about that.

BTW, the resulting CALLing code for a static call is little more than a BALR 14,15 and a load of Reg1 with the parameter address.

Using dynamic calls, memory is searched and/or loadlibs are searched for the desired subpgm. To perform these functions a system module is invoked, initiating a much more complex and time consuming process.

Thanx, Jack.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top