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
 

 

Changing in SORT order of a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Changing in SORT order of a file
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

Site Director


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

PostPosted: Wed Oct 06, 2010 9:53 pm    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Oct 06, 2010 11:57 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Oct 07, 2010 12:15 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Oct 07, 2010 12:49 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Oct 07, 2010 7:23 am    Post subject: Reply to: Changing in SORT order of a file
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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