View previous topic :: View next topic
|
Author |
Message |
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Hi All,
I have to read a VSAM KSDS for some characters , they are part of the key and may exist more than once .. Below is the example of the part of the key.
BOAWHABCDEFGHIJ1234567890(Type H Record)
BOAWDABCDEFGHIJ0987654321(Type D Record)
BOAWDABCDEFGHIJ7635775643(Type D Record)
BOAWDABCDEFGHIJ8723462222(Type D Record)
BOAWDABCDEFGHIJ0987857685(Type D Record)
I have to find the H record and then look for all the D records following the criteria of my search
My search will be based on first 15 bytes of the record that is a partial key as the key is 54 byte long starting form 1st position.
I have tried several ways like Random read first for H record and then STARTBR on First D record and Read-Next there after but I am having different issues in each cases..
I just wanted to have an idea whether I am doing it in right way .. I am doing it like below
Random read on H record --> STARTBR ON first D record --> Loop till the last D record matching the first 15 characters.
Please assist. Thanks
Regards
Sumit Chaturvedi |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
The Type of the record is on position 5 highlighted in Black below
BOAWHABCDEFGHIJ1234567890(Type H Record)
BOAWDABCDEFGHIJ0987654321(Type D Record)
BOAWDABCDEFGHIJ7635775643(Type D Record)
BOAWDABCDEFGHIJ8723462222(Type D Record)
BOAWDABCDEFGHIJ0987857685(Type D Record) |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Sumit, Have you thought of creating alternate index (AIX) on 'H' type of record search? |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
HI Rohit, Thanks for your response
I did not think about it and I guess we will need so many approvals for that |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
You do not exactly say HOW it does not work! I know that for partial keys, you did mention that?, the first read positions the pointer BEFORE the first record that matcheds that key. The next read gets that first record (the H record here) and subsequent reads will get the D records. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
thesumitk wrote: |
The Type of the record is on position 5 highlighted in Black below
BOAWHABCDEFGHIJ1234567890(Type H Record)
BOAWDABCDEFGHIJ0987654321(Type D Record)
BOAWDABCDEFGHIJ7635775643(Type D Record)
BOAWDABCDEFGHIJ8723462222(Type D Record)
BOAWDABCDEFGHIJ0987857685(Type D Record) |
In the file, the records are in this order:
BOAWDABCDEFGHIJ0987654321(Type D Record)
BOAWDABCDEFGHIJ0987857685(Type D Record)
BOAWDABCDEFGHIJ7635775643(Type D Record)
BOAWDABCDEFGHIJ8723462222(Type D Record)
BOAWHABCDEFGHIJ1234567890(Type H Record)
thesumitk wrote: |
I am having different issues in each cases |
Which kind of issues ?
Maybe you can STARTBR then READNEXT to get the H record, then a loop of READPREV to get the D records ?
I haven't worked with VSAM for a long time, you'll have to try and tell if it's feasible. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
I was revisiting what you said so far,
Quote: |
My search will be based on first 15 bytes of the record that is a partial key as the key is 54 byte long starting form 1st position.
I have tried several ways like Random read first for H record and then STARTBR on First D record and Read-Next there after but I am having different issues in each cases.. |
Please list down the DIFFERENT issues? I believe you would be having 'BOAWHABCDEFGHIJ' value in your hand to make a partial search. So as Nic and Marso suggested if you READNEXT till you find 'BOAWHABC?EFGHIJ' (?) something different than 'D' then you should get the correct data. Hope you are using the correct syntax and length while you do a read. Please show us the code which does this. |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Thanks All for your response ,help and your valuable time..
I am trying something else that's why delay in my response.. Please bear with me .. I will giving all the input soon. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Sumit, No rush. All the best. |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Thanks Again to All, for you valuable response !!
I have done it in below way
STARTBR on H Record then ENDBR and STARTBR Again on D record and loop til lthe last matched record and ENDBR.
It is working fine now ..
We have a common I/O routine in our application which is used by almost al lthe online programs to access the online files there is some conditions in that program for the file which I want to access which makes it not working.
So I written my own start and read commands in the program instead oaf accessing that routine and it is working fine now.
Thanks a Lot again for the help.. I need one more suggestions/help
When My process is completed then I am sending a message to the screen in the message area to notify that process was successful but the data which was entered by user is still on that screen .. I want that data to be clear and display my message only do we have an option ion send command for it .. Please let me know .. Thanks
regards
Sumit |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Initialize all 'O' variables of the Map and then just populate only the message field(O) and send it.
If above is not what you want then look for "cics send text". |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Thank you so Much Rohit !!
This is what I wanted and it worked fine ..Thanks |
|
Back to top |
|
|
|