Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Read a blank vsam with a specified key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
feng hao

New User


Joined: 26 Mar 2008
Posts: 44
Location: China

PostPosted: Tue Sep 08, 2009 6:42 pm    Post subject: Read a blank vsam with a specified key
Reply with quote

I tried to read a vsam file with a specified key in PL/1, it is all right whether it could find the one. However, when I make the vsam blank, then the program will get abended with 'ONCODE=82', just like below, but I didn't find nothing correlated between them. Hope anyone could help me.

The UNDEFINEDFILE condition was raised because the data set was never loaded
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8151
Location: East Dubuque, Illinois, USA

PostPosted: Tue Sep 08, 2009 6:45 pm    Post subject:
Reply with quote

First, tell us what you mean by
Quote:
However, when I make the vsam blank
since that statement makes absolutely no sense to me. Are you referring to something in the JCL? the PL/I program? the VSAM file itself? and what, exactly, are you doing to "make the vsam blank"?
Back to top
View user's profile Send private message
feng hao

New User


Joined: 26 Mar 2008
Posts: 44
Location: China

PostPosted: Tue Sep 08, 2009 6:49 pm    Post subject:
Reply with quote

Yes, Robert, I use IDCAMS(repro) to copy an empty dataset to the vsam file, and then the PL/1 execute query against it in the same manner.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8151
Location: East Dubuque, Illinois, USA

PostPosted: Tue Sep 08, 2009 6:54 pm    Post subject:
Reply with quote

You are aware that copying an empty file to a VSAM data set does not empty it (unlike sequential files), right? You are also aware that attempting to read a VSAM file that has never had a record written to it will cause you problems, right?

You absolutely must load the VSAM file with a record after defining it before attempting to read it. You can delete that record after the write, but you cannot skip the write.

All this has been discussed many times on this forum.
Back to top
View user's profile Send private message
feng hao

New User


Joined: 26 Mar 2008
Posts: 44
Location: China

PostPosted: Tue Sep 08, 2009 7:00 pm    Post subject:
Reply with quote

Thank you very much for your detailed explanation, Robert, I got it now totally.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us