View previous topic :: View next topic
|
Author |
Message |
kiran
New User
Joined: 08 Apr 2004 Posts: 25 Location: hyd
|
|
|
|
Hi,
here is an interview question which i faced
what is the difference between
CALL PROG-ID
and
CALL 'PROG-ID'
pls send me the answer |
|
Back to top |
|
|
mdtendulkar
Active User
Joined: 29 Jul 2003 Posts: 237 Location: USA
|
|
|
|
Hello kiran.
CALL PROG-ID
Here PROG-ID is a variable which contains the name of the program to be executed.
CALL 'PROG-ID'
Here PROG-ID is the actual program to be executed.
Hope this helps,
Regards
Mayuresh Tendulkar |
|
Back to top |
|
|
sandip_datta
Active User
Joined: 02 Dec 2003 Posts: 150 Location: Tokyo, Japan
|
|
|
|
CALL PROG-ID
Here the CALL is dynamic call. The Calling program need not be compiled when the called program is compiled.
CALL 'PROG-ID'
Here the CALL is static call. The calling program needs to be compiled when called program is compiled.
Regards,
Sandip. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi kiran,
I may be mistaken but I think (too lazy to look it up) PROG-ID is an invalid module name and the CALL would fail, or if you're lucky, the compiler will catch it.
The dash (- ) is invalid in that context. A minor point, but JIC you didn't already know...
Regards, Jack. |
|
Back to top |
|
|
Arun Joseph
New User
Joined: 30 Mar 2005 Posts: 13 Location: India
|
|
|
|
Just u add in
CALL PROG1
This is a Dynamic call and the program will be referenced only when the original program is executed. So u can compile them in any order but PROG1 shud be compiled before running the original pgm.
CALL 'PROG2'
This is a static call. The load module of this PROG2 will be present as a part of the load module of the original pgm. Tht is y u have to compile PROG2 before compiling the original pgm. And link it up in the link step. |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
the first one is dynamic call and the second one is static call if compiler option is nodynam, where as it is a dynamic call if the compiler option is dynam. |
|
Back to top |
|
|
thiru.guduru
New User
Joined: 06 Apr 2005 Posts: 9 Location: Bangalore
|
|
|
|
Static call is very efficient since the called load module was already in main memory. This will be very useful when u are calling the same program several times.
Dynamic call does't occupy more memory since whenever the call is made then only the called program brought in to memory. After execution of called program u can use cancel verb to remove called module from memory.
Hope this addition information will help u |
|
Back to top |
|
|
Rameshs
New User
Joined: 15 Jun 2005 Posts: 53 Location: India, Chennai
|
|
|
|
where we will give the compiler options ? nodynam / dynam |
|
Back to top |
|
|
mail2romel
New User
Joined: 14 Nov 2005 Posts: 7 Location: pune
|
|
|
|
hi rameshs,
let me anser u'r question.
if u want to go for dynamic call u will have to give parm=dynam in the jcl used for compiling both main program n sub program it will have to be given in the step execution statement.
// STEP 1 EXEC SUBPROC , MEM=SUB1, PARM=DYNAM
in dynamic call u will have to compile only that program in which u have made changes bt for static call u will have to compile all the programs.
if u want to go for static calling u need not do nodynam BY DEFAULT it will take static call
pl correct me if i'm wrong |
|
Back to top |
|
|
|