Cobol

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
shakhila

Cobol

Post by shakhila » Tue Mar 28, 2006 1:58 pm

How to find out from the cobol pgm whether a sub pgm is called statically or dynamically.

User avatar
arrbee
Active Member
Posts: 144
Joined: Fri Feb 24, 2006 11:33 am

Post by arrbee » Tue Mar 28, 2006 3:02 pm

Static Call:

CALL 'PGRM1' USING VAR-1, VAR-2.

Dynamic Call:

CALL WS-PGRM1 USING VAR-1, VAR-2.

Code: Select all

The WS-PGRM1 should have been declared in working-storage with a PIC of X(08).
HTH.
Arr Bee
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)

asif321
Member
Posts: 6
Joined: Fri May 04, 2012 3:55 pm

Post by asif321 » Sat May 05, 2012 7:05 pm

The ONLY way is to look at the output of the linkage editor (IEWL) or the load module itself. If the module is being called DYNAMICALLY then it will not exist in the main module, if it is being called STATICALLY then it will be seen in the load module.
Last edited by asif321 on Sun May 06, 2012 10:01 am, edited 1 time in total.

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Sat May 05, 2012 7:45 pm

any CALL variable is Dynamic.

to determine if a CALL literal
is Dynamic or Static,
one would also need to see the Compiler Options and the Linkedit Options and library setup.

as a result,
you can not determine if a CALL literal is dynamic or static
by just looking at the source.


As Asif321 indicated,
it is faster and easier to just look at the Load Module.

and congratulations Aisf321 for posting to a thread that has been dormant for 6 years.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others