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

Doubt regardin storing values in an Array


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shweta12j

New User


Joined: 10 May 2010
Posts: 32
Location: Mumbai

PostPosted: Wed Dec 01, 2010 8:22 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 01, 2010 10:16 pm
Reply with quote

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
View user's profile Send private message
Shweta12j

New User


Joined: 10 May 2010
Posts: 32
Location: Mumbai

PostPosted: Thu Dec 02, 2010 11:46 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Dec 02, 2010 8:47 pm
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Dec 02, 2010 10:08 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Dec 02, 2010 10:21 pm
Reply with quote

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
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Storing a BLOB/CLOB in PL/I PL/I & Assembler 4
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
Search our Forums:

Back to Top