View previous topic :: View next topic
|
Author |
Message |
Shweta12j
New User
Joined: 10 May 2010 Posts: 32 Location: Mumbai
|
|
|
|
Hello All,
I need your expert advise with respect to below mentioned query:
Module A passes program name in array of 3 to module B
Code: |
code
01 DIM-PARM.
03 PROG-NAAM OCCURS 3.
05 PROG-NAAM-IND PIC X(6).
05 FILLER PIC X(2).
|
Module B has its own internal array which checks if there if is any repetative occurance of any input.
Code: |
IF ( (PROG-NAAM IN DIM-PARM =
TAB-PROG-NAME(S-HLP) )
END-IF
|
Now my doubt is if there are many programs which consecutively calls MODULE B then will there be a problem in storing the program names in an internal array of module B..
Hope my query is clear to you all..
Note: Module B is dynamically called
Regards,
Shweta |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Unless there is something i misunderstand, there is no problem. . .
Each of the processes that call module B will use a separate copy of module B including the internal array. . . |
|
Back to top |
|
|
Shweta12j
New User
Joined: 10 May 2010 Posts: 32 Location: Mumbai
|
|
|
|
Thanks Dick for your response..
Will it make any difference to internal storage of an array irrespective how the Module B is called meaning in terms of static or dynamic..
Appreciate your suggestion on this!
Regards,
Shweta. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The way storage for your process is mapped during execution can vary between a static call and a dynamic call, but the code does not need to be aware of this.
The biggest difference between a static call and a dynamic call is that the calling modules are "locked in" to the statically called module. A dynamic call gets the most current copy of the called module. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
But it makes no difference in referencing the data parameter storage adresses in the called module if the call is static or dynamic.
Do you refer to internal storage in module B as storage defined in working storage section? Working storage is by default undefined on first call in an application invocation, and can be assumed to be in the state it was left in at subsequent calls. Parallel invocations of an application will by default get their own working storage. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If the OP is using VS/COBOL II or greater, he/she can save themselves a lot of grief by defining the array in program A and (exactly the same definition) in program B as EXTERNAL WS.
As soon as program A builds the array and program B is called, program B will have access to the program A array.
If program B makes any changes to the array, it will be reflected in program A and vice-versa.
EXTERNAL storage can be addressed by any module within the run unit.
Consult your applicable IBM COBOL manual for additional information as well as search this forum because I'm certain EXTERNAL WS has been discussed before.
Keep in mind if you're using OS/VS COBOL, this won't work.
Bill |
|
Back to top |
|
|
|