Deleting records from ESDS data set.

All sort of Mainframes Interview Questions.
Post Reply
Mamta LDH
New Member
Posts: 8
Joined: Fri Feb 28, 2014 1:35 am

Deleting records from ESDS data set.

Post by Mamta LDH »

I was asked if we can delete a record from ESDS?

I said , No, we cannot delete a record from ESDS. To this interviewer said, have you ever tried it?

I replied no. I never needed such a logic in my programs. But I have read about this that we can not delete a record from ESDS data sets. "That's in theory. I have deleted a record from ESDS many times" , interviewer said.

I still think that we can not physically delete the records from ESDS but I might be wrong. Can anyone please help me on this.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: Deleting records from ESDS data set.

Post by zprogrammer »

You cannot delete records from ESDS file

If you need records not to be present in output eliminate them through SORT

Suggest you to read through VSAM DEMYSTIFIED
zprogrammer
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Deleting records from ESDS data set.

Post by William Collins »

The ES, Entry Sequenced, in ESDS is the give-away. No, you cannot delete a record from an ESDS. Absolutely cast iron, rock solid. Anyone who tells you otherwise is an idiot. A record on an ESDS can be accessed by its RBA (Relative Byte Address). That would not work if the RBA was subject to change through record-deletion. The only way it could be done would be to "shuffle along" the subsequent records in the file. Fortunately, that was an original design choice easily avoided.

To remove records from an ESDS, you need something which will read a copy of the original and write to the original ESDS (ensuring that the data is not "tacked on at the end" through one of various means).
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”