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

Changing in SORT order of a file


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
smaru

New User


Joined: 22 Oct 2008
Posts: 49
Location: India

PostPosted: Wed Oct 06, 2010 8:53 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Wed Oct 06, 2010 9:53 pm
Reply with quote

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 icon_confused.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Oct 06, 2010 10:08 pm
Reply with quote

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

New User


Joined: 22 Oct 2008
Posts: 49
Location: India

PostPosted: Wed Oct 06, 2010 10:13 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Wed Oct 06, 2010 11:57 pm
Reply with quote

Hello,

As i mentioned before, add another key - in the order you want. . .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Oct 07, 2010 12:09 am
Reply with quote

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

Moderator Emeritus


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

PostPosted: Thu Oct 07, 2010 12:15 am
Reply with quote

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

New User


Joined: 22 Oct 2008
Posts: 49
Location: India

PostPosted: Thu Oct 07, 2010 12:39 am
Reply with quote

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

Moderator Emeritus


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

PostPosted: Thu Oct 07, 2010 12:49 am
Reply with quote

Hello,

Then, you're back to adding the additional key. . .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Oct 07, 2010 1:13 am
Reply with quote

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

Moderator Emeritus


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

PostPosted: Thu Oct 07, 2010 7:23 am
Reply with quote

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
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top