Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Difference in CALL statements

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Difference in CALL statements
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: 238
Location: USA

PostPosted: Fri Apr 16, 2004 2:57 pm    Post subject:
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: 151
Location: Tokyo, Japan

PostPosted: Mon Apr 19, 2004 8:13 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: Difference in CALL statements
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Cobol EZASOKET call to SETSOCKOPT fails Andi1982 COBOL Programming 6 Thu Oct 06, 2016 7:12 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us