View previous topic :: View next topic
|
Author |
Message |
poongs Warnings : 1 New User
Joined: 24 Jan 2007 Posts: 28 Location: pune
|
|
|
|
Hi ppl,
I'm facing a problem when i'm trying to write a record to a ksds file.
The scenario is :
I have a vsam file whose key length is 15(ws-code).I have another vsam file whose key-length is 45(where ws-code is the first 15 char in this key).Now,i'll read the first vsam file and read the second vsam file sequentially to match the ws-code key value,and if entry is found i have to write this record from the second vsam file to a new vsam file.The new vsam file contains some data(same key length of 45 ).I have opened the new VSAM file in I-O mode and DISP=(OLD,KEEP,KEEP).While i'm tryin got write the record in the new vsam file ,i'm gettin vsam error 92(logic error).What i needed to confirm is that..can i write to a ksds file without specifying the key value,as in my case i don't know the whole 45 length key value. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Poongs,
Quote: |
I have opened the new VSAM file in I-O mode and DISP=(OLD,KEEP,KEEP). |
Change disp to MOD. |
|
Back to top |
|
|
poongs Warnings : 1 New User
Joined: 24 Jan 2007 Posts: 28 Location: pune
|
|
|
|
But,
If my understanding is correct,MOD is for appending the records...and in my case,the records are in a sequence(sorted by the 45 length key).So in this case,obviously it'll pick up the first record for the matching 15 length ws-code of the vsam's key.I havea doubt like since i'm not supplying the total key,it is encountering a logica error.
p.s:- I had tried giving MOD also in the DISP.But it din turn fruitful.... |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
poongs wrote: |
can i write to a ksds file without specifying the key value,as in my case i don't know the whole 45 length key value. |
That's silly, the rest of the key is in the record you are writing.....
Try providing the additional six byte field to the file status to get the full vsam error values..... |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
poongs,
Quote: |
While i'm tryin got write the record in the new vsam file ,i'm gettin vsam error 92(logic error). |
I think you are trying to write a vsam file which was opened in INPUT mode.
If you will post the cobol code, then it will be useful to help you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Keep in mind that when you write new records, you need to provide all 45 bytes of the key. If only the first 15 have meaningful data, fine, but all 45 will be written.
You need to decide if you will use spaces, zeros, or some other value for the 30 bytes that there is no meaningful value for. |
|
Back to top |
|
|
poongs Warnings : 1 New User
Joined: 24 Jan 2007 Posts: 28 Location: pune
|
|
|
|
Thnk u Guys !!
I will pass zeroes or spaces for the remaining 30 bytes.But i still have an doubt like if we give only 15 byte value of the key....(in case i have initalized the other 30 byte value to zeroes),will i b able to write the record?And the file is opened in Sequential mode. |
|
Back to top |
|
|
|