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
 

 

reading a KSDS file in sequential mode

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: reading a KSDS file in sequential mode
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: 1439
Location: Bangalore,India

PostPosted: Fri Sep 21, 2007 6:03 pm    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Fri Sep 21, 2007 6:16 pm    Post subject: Re: reading a KSDS file in sequential mode
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    Post subject:
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

Site Director


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

PostPosted: Fri Sep 21, 2007 9:35 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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