IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Difference in CALL statements


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kiran

New User


Joined: 08 Apr 2004
Posts: 25
Location: hyd

PostPosted: Fri Apr 16, 2004 12:12 pm
Reply with quote

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
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Fri Apr 16, 2004 2:57 pm
Reply with quote

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
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

PostPosted: Mon Apr 19, 2004 8:13 am
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Apr 19, 2004 7:33 pm
Reply with quote

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
View user's profile Send private message
Arun Joseph

New User


Joined: 30 Mar 2005
Posts: 13
Location: India

PostPosted: Wed Mar 30, 2005 9:36 pm
Reply with quote

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
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Wed Apr 06, 2005 2:33 pm
Reply with quote

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
View user's profile Send private message
thiru.guduru

New User


Joined: 06 Apr 2005
Posts: 9
Location: Bangalore

PostPosted: Wed Apr 06, 2005 5:15 pm
Reply with quote

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
View user's profile Send private message
Rameshs

New User


Joined: 15 Jun 2005
Posts: 53
Location: India, Chennai

PostPosted: Tue Sep 13, 2005 12:43 pm
Reply with quote

where we will give the compiler options ? nodynam / dynam
Back to top
View user's profile Send private message
mail2romel

New User


Joined: 14 Nov 2005
Posts: 7
Location: pune

PostPosted: Mon Dec 05, 2005 12:17 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
Search our Forums:

Back to Top