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: 686
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 REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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