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
 

 

Cobol Sub-Program and Main-Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 35
Location: India

PostPosted: Sat Oct 17, 2015 10:48 am    Post subject: Cobol Sub-Program and Main-Program
Reply with quote

How can we identify just by looking at the program whether the subprogram is called Statically or Dynamically? Except below one.

Calling the Literal value is Static call and Calling the Variable is a Dynamic Call. Does it holds good in all conditions??? (i.e. Irrespective of other compiler options in effect)

Is there any other way to identify the type of call just by looking at the program?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat Oct 17, 2015 1:56 pm    Post subject: Reply to: Cobol Sub-Program and Main-Program
Reply with quote

CALL identifier is always dynamic. CALL literal depends on compiler option.

Note, there is nothing special or different about a "main-program" or a "sub-proram" in COBOL. You can CALL an "main-program" it'll work just the same.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8132
Location: East Dubuque, Illinois, USA

PostPosted: Sat Oct 17, 2015 11:23 pm    Post subject:
Reply with quote

Quote:
Is there any other way to identify the type of call just by looking at the program?
Not without looking at the compile options -- a CALL literal may be a static call in one program and dynamic in another program based upon the compile options.
Back to top
View user's profile Send private message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 35
Location: India

PostPosted: Mon Oct 19, 2015 11:56 am    Post subject: Reply to: Cobol Sub-Program and Main-Program
Reply with quote

Depends on what compiler options?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Oct 19, 2015 2:23 pm    Post subject: Reply to: Cobol Sub-Program and Main-Program
Reply with quote

Whether DYNAM or NODYNAM is used.

This question has been asked many times. Didn't your search-engineing reveal anything?
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1742
Location: NY,USA

PostPosted: Mon Oct 19, 2015 8:42 pm    Post subject:
Reply with quote

Code:
If compiled as NODYNAM:
CALL 'literal' is a static call
CALL WS-label is a dynamic call

If compiled as DYNAM:
CALL 'literal' is a dynamic call
CALL WS-label is a dynamic call


So answer to your original question is NO. we can't judge that by simply lookin at the program.
Back to top
View user's profile Send private message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 35
Location: India

PostPosted: Mon Oct 19, 2015 9:45 pm    Post subject: Reply to: Cobol Sub-Program and Main-Program
Reply with quote

Basically my question is, In-spite of DYNAM or NODYNAM in effect. The way program is called : Literal or Identifier, does any other compiler option or any other parameter has effect on way of calling a program.


Also I think if we examine the loads, we can determine whether it is statically called or dynamically called.

Suggestions please
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Oct 19, 2015 9:56 pm    Post subject: Reply to: Cobol Sub-Program and Main-Program
Reply with quote

Nothing else than what has been mentioned already affects whether a program is statically or dynamically CALLed. You cannot tell by looking at the source, end of story.

If you have a loadmodule (or Program Object with V5 of Enterprise COBOL) of course you can determine the difference. The code generated is different for static than for dynamic.

There must be another question underneath this, you've been clearly answered so far but are still looking...
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm


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