View previous topic :: View next topic
|
Author |
Message |
feng hao
New User
Joined: 26 Mar 2008 Posts: 44 Location: China
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
feng hao
New User
Joined: 26 Mar 2008 Posts: 44 Location: China
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
feng hao
New User
Joined: 26 Mar 2008 Posts: 44 Location: China
|
|
|
|
Thank you very much for your detailed explanation, Robert, I got it now totally. |
|
Back to top |
|
|
|