Need help in READing VSAM file for a situation



Support for CICS/ESA, CICS/TS & Transaction Gateway, CICS Configuration Manager and CICS Performance Analyzer

Need help in READing VSAM file for a situation

Postby kamal » Sun Jun 20, 2010 11:59 am

Hi All
I need to read a VSAM file with 10 bytes long key.
05 WS-KEY-FULL.
10 WS-KEY-PART1 PIC X(05).
10 WS-KEY-PART2 PIC X(05).

I have to show all the records on screen (paging) having some value in PART2 of the key
User enters PART2 on the screen. I get PART2 value from screen and display data pagewise.

This VSAM file has `10 million records.

Please suggest effective way of doing it.
1.Readnext commands:
Which format of readnext command can be used ?
2.Alternate Index:
I am not aware if there are any filesize constrains on reading alternate index.
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in READing VSAM file for a situation

 

Re: Need help in READing VSAM file for a situation

Postby Robert Sample » Sun Jun 20, 2010 5:21 pm

Your first option is not a good one. Generic key reads require you start at the first byte of the key. Since you are starting from the sixth byte of the key, you would have to use READ NEXT to read every record in the file to select the records you want.

Alternate index (AIX) may -- and that depends upon your data -- work. The key relevant limit is that an AIX with duplicates is limited to 32767 occurrences. If any of your PART2 values occurs more than 32767 times, you cannot use alternate index -- in which case your only choice will be a complete redesign. http://www.redbooks.ibm.com/abstracts/sg246105.html?Open is the VSAM Demystified redbook and a good place to start. Also read the DEFINE ALTERNATEINDEX section in the Access Method Services for Catalogs manual.
Robert Sample
Global moderator
 
Posts: 3130
Joined: Sat Dec 19, 2009 8:32 pm
Location: Bellevue, Iowa
Has thanked: 1 time
Been thanked: 185 times

Re: Need help in READing VSAM file for a situation

Postby kamal » Mon Jun 21, 2010 4:42 pm

Thanks for this information.
I will check my Input file(s) if there are duplicates > 32767 @ AIX field.
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in READing VSAM file for a situation

Postby kamal » Tue Jun 22, 2010 12:47 pm

The file has maximum 100 duplicates on AIX field.
I will use alternate Index. Thanks again for guidance.
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in READing VSAM file for a situation

Postby kamal » Mon Jul 05, 2010 11:30 am

I created alternate index and using it behind the screens. Its working fine while browsing.
Now , I need to update BASE cluster , will the AIX file be updated automatically ? It's not happening for me currently.
May be I am not using correct options while creating AIX or FCT entry.
Please advice.
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in READing VSAM file for a situation

Postby Robert Sample » Sun Jul 11, 2010 8:41 pm

Do you have UPGRADE specified in the AIX definition?
Robert Sample
Global moderator
 
Posts: 3130
Joined: Sat Dec 19, 2009 8:32 pm
Location: Bellevue, Iowa
Has thanked: 1 time
Been thanked: 185 times

Re: Need help in READing VSAM file for a situation

Postby kamal » Thu Jul 22, 2010 12:25 pm

It's working as expected after using UPGRADE option in the AIX definition.I realised it after posting this Q.
Thanks Robert Sample!
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help in READing VSAM file for a situation

Postby Robert Sample » Thu Jul 22, 2010 4:35 pm

Glad to hear you got it working.
Robert Sample
Global moderator
 
Posts: 3130
Joined: Sat Dec 19, 2009 8:32 pm
Location: Bellevue, Iowa
Has thanked: 1 time
Been thanked: 185 times


Return to CICS

 


  • Related topics
    Replies
    Views
    Last post