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

Read a blank vsam with a specified key


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 08, 2009 6:45 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 08, 2009 6:54 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts CVDA value for RRDS VSAM dataset. CICS 2
Search our Forums:

Back to Top