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
 

 

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: 8054
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: 8054
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 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
No new posts Read of TDQ fails in LENGERR Tracy Hansen CICS 10 Wed Apr 05, 2017 12:10 am
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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