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
 

 

Doubt regardin storing values in an Array

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Doubt regardin storing values in an Array
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

Site Director


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

PostPosted: Wed Dec 01, 2010 10:16 pm    Post subject:
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    Post subject: Reply to: Doubt regardin storing values in an Array
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

Site Director


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

PostPosted: Thu Dec 02, 2010 8:47 pm    Post subject:
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Dec 02, 2010 10:21 pm    Post subject: Reply to: Doubt regardin storing values in an Array
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    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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm


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