View previous topic :: View next topic
|
Author |
Message |
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
Guys could you help me with a clarification.
Is there a difference in the storage occupied between the two declarations given below.
Code: |
01 ARRAY-NAME.
05 ARRAY-OCCURANCES OCCURS 9000 TIMES DEPENDING ON
ARRAY-COUNTER.
10 DATA PIC X(1000). |
and
Code: |
01 ARRAY-NAME.
05 ARRAY-OCCURANCES OCCURS 0 TIMES 9000 TIMES DEPENDING ON
ARRAY-COUNTER.
10 DATA PIC X(1000).
|
Will the depending on clause make sence in the first declaration ? or will it be only useful in the second statement. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
If the COBOL Internal Table (loosly called as arrays, whcih is not actually a COBOL term) is defined in Working-Storage with the ODO phrase, it will always be mapped to max potential size. (FILE SECTION or LINKAGE SECTION are exception).
The only way to have a "dynamic array" is to acquire storage at runtime basing your size requirement on the number of items you will have. This excellent explanation by Bill O'Boyle here might be of further interest. |
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
Anuj , yes my bad , agreed its COBOL Internal Table .
Let me give more insight of the issue am facing. I have this declaration in mmy CICS program , and my program is ending up issuing huge GETMAINS. After some analysis we narrowed down to the storage thats allocated at the begining of the program.
Ans seems the culprit there could be the way these COBOL Internal Tables have been declared. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
1. do you need these Cobol Internal Tables?
2. do you know at run time (before you populate them)
how many items you will have?
if the answers are yes/no - you are stuck.
if the answers are yes/yes - then use the method Bill has described (refer to the link that Anuj has provided).
with what are you populating these Cobol Internal Tables?
what is the frequency/activity of your cics module?
when you perform activities in cics that should be done in batch,
you always pay a price. |
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
Thanks for all the responses.
@dbzTHEdinosauer answer is Yes/no.
The Cobol Internal Tables are used to populate the response containers of a Web service request.
Frequency is 7-8 calls / minute.
Ok coming back to my orginal question , does the two declaration make any difference or is it same ? ( I am intrested in this beacause i am being told that the second declaration would only allocate the spce that is equivalent to the Cobol Internal Tables size and not the max by default)
I actually dont know how to validate the statement. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
again I ask, where is the data comming from to populate the tables?
why don't you use the container space? that memory is already allocated.
since the COBOL internal table is defined in working-storage,
the max is allocated.
look at the compile listing to validate the statement,
if you do not want to read the manuals.
now, you can continue to work with the incompetents that are giving you such garbage as info,
or you can work with us.
if you wish to work with us, answer our questions.
with what are you populating your COBOL Internal tables?
where are you getting the data?
what is the relationship of the COBOL Internal Table items
and the container space?
many of us have worked with web-apps, this is not new ground.
in order for us to help you, you need to explain what is the function of you cics service. |
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
with what are you populating your COBOL Internal tables? Data extracted from a DB2 table depending on a varying query( user has the flexibity to choose his WHERE clause) result from my cursor is poluated into the container which has the cobol internal table. Each row from the cursor is moved to the cobol internal table
where are you getting the data? DB2 table
what is the relationship of the COBOL Internal Table items
and the container space? COBOL Internal Table is actually in the copybook definition of my container
Quote: |
now, you can continue to work with the incompetents that are giving you such garbage as info,
or you can work with us. |
Very polite way of explaining stuffs ?? anywas not related to the topic in hand for now
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
cvishu wrote: |
Guys could you help me with a clarification.
Is there a difference in the storage occupied between the two declarations given below.
Code: |
01 ARRAY-NAME.
05 ARRAY-OCCURANCES OCCURS 9000 TIMES DEPENDING ON
ARRAY-COUNTER.
10 DATA PIC X(1000). |
and
Code: |
01 ARRAY-NAME.
05 ARRAY-OCCURANCES OCCURS 0 TIMES 9000 TIMES DEPENDING ON
ARRAY-COUNTER.
10 DATA PIC X(1000).
|
Will the depending on clause make sence in the first declaration ? or will it be only useful in the second statement. |
Can't say I've ever coded it like the first, so write a little program with it in, see if it compiles, see if you can use fewer than 9000 occurrences (use compiler option SSRANGE).
If the first compiles, the second will define an identical amount of storage in your program, ie 9000 * 1000 bytes.
Actually, looking at your second you mean "0 TO 9000" if you want it to compile... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
1. as bill has pointed out, neither of your COBOL Internal Table declarations is compilable.
2. Container space comes from the
gateway/whatever interface you are using between the web-app and the cics invocation of your program
so it should be defined in linkage.
Thus you should not have any working-storage issues.
3. you quoted your co-workers explanation,
i just pointed out that it is wrong.
if they think that way, they are incompetent.
this is a technical forum. |
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
Quote: |
Actually, looking at your second you mean "0 TO 9000" if you want it to compile |
Yes you are correct it was a typo |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
regardless of where the declaration is,
it is always mapped at the max.
allocation:
working-storage - max
linkage depends on the length sent to the getmain service.
the length of function will return a length based on the value of the odo.
mapped and allocation are two different things. |
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
Thnks guys, for all your replies (Bill O'Boyle link was informative thnks Anuj)
I tried different option, and personally my conclusion is to reduce the occurances from 9000 to a much lesser value , and go for mutiple web service call. ( In short, having some kind of recurrsive calls to get the data rather than getting everything in one go) this worked and reduced my CICS storage allocation.
This is the only solution that i have for my problem as of now. But please keep posting if you think of other ways. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Thanks Dick. I should have been careful .... |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Preface: CICS CHANNELS/CONTAINERS were introduced with CICS/TS 3.1.
However, this initial introduction still had CHANNEL/CONTAINERS writing to EUDSA and if you have several large GETMAIN's being issued concurrently (also using EUDSA), you run the risk of SOS Above the Line.
Upon introduction of TS/3.2, a new initialization parm was added, named MEMLIMIT. The value set to this parm represents the allocation of 64-Bit storage, used internally by CICS, with a miniumum value of 3GB.
With this new parm, CHANNELS/CONTAINERS are now written internally to this 64-Bit storage, so large GETMAIN's can be replaced.
Not sure about your CICS Version/Release, but this could be an option if you're at TS/3.2 and greater.
HTH.... |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
I forgot to ask; What's the data-origin used to populate the dynamic table/array in the CICS program? File, program calculation/logic, another program, etc? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Nevermind, I stand corrected.... |
|
Back to top |
|
|
|