IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Change Static Call to Dynamic Call


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 691
Location: Earth

PostPosted: Tue Aug 07, 2007 11:04 am
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: 128
Location: Guntur

PostPosted: Tue Aug 07, 2007 11:11 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts JCL Dynamic System Symbols JCL & VSAM 3
No new posts Call program, directly from panel CLIST & REXX 9
Search our Forums:

Back to Top