View previous topic :: View next topic
|
Author |
Message |
smaru
New User
Joined: 22 Oct 2008 Posts: 49 Location: India
|
|
|
|
I have a requirement in a CICS program.
I have a VSAM file which is having the key
STATE + AREA + ZONE
NY A 01
NY A 05
NY B 03
NY C 04
and so on..
Right now, when i am doing an inquiry on STATE,its displaying on the sorted order of AREA.
for NY.
01 A 05 A 05 B 04 C
But my requirement is to display the data based on ZONE for each state.for NY, the data should be displayed
01 A 03 B 04 c 05 A
I was thinking of doing a sort on the array, but i can have up to 99999 records for one state.i think its not good performance wise so i don't want to use that way.
It would be great if someone could suggest a solution for this scenario. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Add a key for "zone" or "zone/area" or "zone/state/area" or whatever. . .
Actually, i believe 99999 is a bit much for one transaction to work with - even without sorting |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
how much data do you have to display for each record?
what is the total vsam file size?
and how large is the zone and area field? |
|
Back to top |
|
|
smaru
New User
Joined: 22 Oct 2008 Posts: 49 Location: India
|
|
|
|
VSAM size - 12 bytes
State field size - 4
Zone field size - 3
Area field size - 5
If the Map is being inquired for one state, i will have to display all the zone and area for it. One state can have an average of 10,000 where Maximum limit being 99999.
Since the VSAM primary key is STATE+ZONE+AREA but the requirement is to display in the sequence of STATE+AREA+ZONE.
Appreciate your quick reply. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As i mentioned before, add another key - in the order you want. . . |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
a 12 byte record?
another key would cost you an additional 12 bytes.
i would create another file. you could use sort to create the new vsam file.
what process creates/updates this file?
and why, since we are talking about states of the US,
isn't the state field only 2 - for which there is a definitive 2 char state definition? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
i would create another file. you could use sort to create the new vsam file. |
Yup, that would work well.
When i saw the original "file specification" i decided it was only a partial or that there are already a lot of design problems. . . |
|
Back to top |
|
|
smaru
New User
Joined: 22 Oct 2008 Posts: 49 Location: India
|
|
|
|
The state was just a generic example.
It will not be feasible for me to introduce a NEW vsam file as the main file is used in many batch and online pgms.
they all do the updates and this screen is just for the inquiry purpose.
We need to display the records in the screen in a different sequence than what the key is. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Then, you're back to adding the additional key. . . |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
This whole set-up and 'requirement' is nonsense and as such,
will excuse myself from this thread with the following comment:
there are ways for cics modules to invoke SORT products and provide what you need. suggest you check with your support people or start surfing. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Dick,
Quote: |
This whole set-up and 'requirement' is nonsense and . . . |
Methinks there will be considerable problems when this gets iknto anything approaching full-volume, multi-user testing. Well, if it ever does. All too often as soon as something "works at all" it is deployed and then the real excitement begins. . .
d |
|
Back to top |
|
|
|