View previous topic :: View next topic
|
Author |
Message |
Jeenu Bajaj
New User
Joined: 20 Aug 2015 Posts: 3 Location: Gurgaon
|
|
|
|
I have 2 KSDS Files, One which I deleted defined and it contains No Records. And the other KSDS File, from which I deleted all the records.
There is a difference in these 2 files, Can anybody please let me know what it is.
When i am browsing the first one, I am not able to browse it, it says Empty File. But I can browse the second file, although that also does not have any record. I tried giving the 2 files in JCL as input. For first one, JCL fails with file status code 35, as we all know we can not open empty VSAM file for input. But with Second type of file, JCL runs smoothly without giving any error |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
To be opened successfully for reading, a KSDS must have had at least one record written to it, even if it currently contains no records. |
|
Back to top |
|
|
Jeenu Bajaj
New User
Joined: 20 Aug 2015 Posts: 3 Location: Gurgaon
|
|
|
|
But when I deleted all records from KSDS File, I was still able to browse the file |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes.... and? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You need to find and read the Redbook VSAM Demystified where you can find all sorts of information about VSAM. The behavior you posted is normal and expected -- VSAM distinguishes between an empty file (that has never had a record) and a file with no records in it. They are not the same, so why would you expect the browse (or anything else, for that matter) to work the same? |
|
Back to top |
|
|
Jeenu Bajaj
New User
Joined: 20 Aug 2015 Posts: 3 Location: Gurgaon
|
|
|
|
Ok. Got it!! Thanks a ton guys for your answers!! |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 580 Location: London
|
|
|
|
Jeenu..once you load a record to a VSAM file it formats the Control Interval (or CI...kind of like a block in NONVSAM terms) and leaves it formatted even if you delete the record.
If no record is ever loaded to the file there are no formatted CI's and VSAM recognises the difference.
There's a program around on the web called VSAMINIT that will 'initialise' a file for you by inserting and (optionally) deleting a record into the file, but you could write your own version to. |
|
Back to top |
|
|
|