Static or dynamic call in COBOL.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
R Patil
New Member
Posts: 5
Joined: Wed Jun 11, 2014 8:21 pm

Static or dynamic call in COBOL.

Post by R Patil »

Hi,

I've this with me in a program:

Code: Select all

01 WS-PROG PIC X(8) VALUE ' DATEROUT'.
..
CALL WS-PROG.
Compiler options used: NODYNAM

Is this a dynamic or static call? As the option is NODYNAM, I'd assume it's a static call. But one of collegues says otehrwise. Please share yourviews.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Static or dynamic call in COBOL.

Post by William Collins »

Whenever CALL identifier is used it is a dynamic CALL. It has to be, since the compiler cannot always reliably know what value the identifier has from CALL to CALL at run-time.

Compiler option DYNAM/NODYNAM only controls the behaviour of CALL literal.
R Patil
New Member
Posts: 5
Joined: Wed Jun 11, 2014 8:21 pm

Re: Static or dynamic call in COBOL.

Post by R Patil »

William Collins wrote:Whenever CALL identifier is used it is a dynamic CALL. It has to be, since the compiler cannot always reliably know what value the identifier has from CALL to CALL at run-time.

Compiler option DYNAM/NODYNAM only controls the behaviour of CALL literal.
Thanks but that's strange. I always thought it call depends on the compiler option! :shock:

Then what's the use of making a default compiiler option as NODYNAM and mandate it on the shop while as a programmer I can anyways make it behave DYAM? :?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Static or dynamic call in COBOL.

Post by Robert Sample »

I think you have totally missed the point. CALL WS-PROG, where WS-PROG has the value 'DATEROUT' will be a dynamic call -- period. This is because COBOL does not know the name of the subprogram to be called until the program is executing.

However, CALL 'DATEROUT' may be either a static OR dynamic call -- depending upon the compiler option. If the compiler option is NODYNAM, you are not going to make it a dynamic call since the compiler can identify the subprogram at COMPILE time and take that into account -- so at execution time the name of the subprogram has been fixed and is part of the load module.
jjourneyy22
New Member
Posts: 3
Joined: Thu Feb 26, 2015 12:23 pm

Re: Static or dynamic call in COBOL.

Post by jjourneyy22 »

Nowdays players should focus FIFA 15 PC Coins on testing the movement and weapons, although I have to Fifa Ultimate Team Coins agree that it's time to see some "advance" in the PvE aspect or otherwise players will start to leave the game.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”