View previous topic :: View next topic
|
Author |
Message |
ramdantu
New User
Joined: 24 Nov 2004 Posts: 3
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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 |
|
|
balakrishna reddy
Active User
Joined: 13 Jul 2007 Posts: 128 Location: Guntur
|
|
|
|
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 |
|
Back to top |
|
|
karisurya
New User
Joined: 02 Aug 2007 Posts: 64 Location: Bangalore
|
|
|
|
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 |
|
|
|