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

reading a KSDS file in sequential mode


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
poongs
Warnings : 1

New User


Joined: 24 Jan 2007
Posts: 28
Location: pune

PostPosted: Fri Sep 21, 2007 6:01 pm
Reply with quote

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

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Sep 21, 2007 6:03 pm
Reply with quote

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
View user's profile Send private message
poongs
Warnings : 1

New User


Joined: 24 Jan 2007
Posts: 28
Location: pune

PostPosted: Fri Sep 21, 2007 6:09 pm
Reply with quote

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

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Sep 21, 2007 6:16 pm
Reply with quote

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

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Sep 21, 2007 7:25 pm
Reply with quote

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

Moderator Emeritus


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

PostPosted: Fri Sep 21, 2007 9:35 pm
Reply with quote

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
View user's profile Send private message
poongs
Warnings : 1

New User


Joined: 24 Jan 2007
Posts: 28
Location: pune

PostPosted: Sun Sep 23, 2007 9:13 am
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts HILITE on Browse mode? TSO/ISPF 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top