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
 

 

Change Static Call to Dynamic Call

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ramdantu

New User


Joined: 24 Nov 2004
Posts: 3

PostPosted: Tue Aug 07, 2007 10:53 am    Post subject: Change Static Call to Dynamic Call
Reply with quote

HI All,

Could you please let me know what are the changes & care I need to take
while changing a Static Call to Dynamic Call.

More Clear of my question ...........

I am calling one Sub Program which is a Static Call from my MAIN
PROGRAM. Now I wanted to change this as needs call a Dynamic Call
instead of this Static Call from this Main Program.

For this what kind of changes I needs to take in this Main Program ?

Could you please let me know if any one face the same kind of issue.


Thanks and Regards
Siva....
Back to top
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Tue Aug 07, 2007 11:04 am    Post subject:
Reply with quote

le me ask you two questions-
What are tha compiler options with which you are compiling the program?
How you are calling the subprog, using literal name?

Best way will be to use a variable instead of a literal, so that call is dynamic irrespective of compiler options.
01 prog-name pic x(08).

Move 'subprog' to prog-name
call prog-name.

good luck!
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Tue Aug 07, 2007 11:11 am    Post subject:
Reply with quote

hi Siva,

you can call a sub-program dynamically by declaring a variable in the working storage section as follows.

Code:

WORKING-STORAGE SECTION.

01  SUB-PRGM   PIC  X(10).

PROCEDURE DIVISION USING VAR1,VAR2.
MOVE 'CALLEDPRGM' TO SUB-PRGM.
CALL SUB-PRGM.
STOP RUN.


if you want to call some other program dynamically at any instance of program execution, just move that program name to sub-prgm variable and call sub-prgm, but that program name should be of length 10 as we have declared in the working storage section.

please correct me if i am wrong icon_neutral.gif
Back to top
View user's profile Send private message
karisurya

New User


Joined: 02 Aug 2007
Posts: 64
Location: Bangalore

PostPosted: Tue Aug 07, 2007 11:12 am    Post subject:
Reply with quote

I dont think u have to do any modifications to the program, The only modification required to be at the compilation level. You have to do the following modification
1) Ensure that you pass the "DYNAM" as the Parm for IGYCRCTL
2) Ensure to include the loadib of the subprogram under SYSLIB for "IEWL"
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 Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 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