Page 1 of 1

how to remove bad record from a file?

Posted: Mon Apr 24, 2023 10:31 pm
by Vinod M
how to remove bad record from a file?

Re: how to remove bad record from a file?

Posted: Tue Apr 25, 2023 6:37 pm
by Robert Sample
Well, that depends partly on the format of the data set.

For a VSAM KSDS, you can program a DELETE command for the key of the bad record.

For a VSAM ESDS or other sequential data set, you copy the entire data set to another one, omitting the bad record. Copying it back to the original location is optional.

For a VSAM RRDS, you may need to rebuild it without the bad record.

For a VSAM LDS, you don't have a bad record because LDS are not record-oriented.

For a PDS or PDSE, you have to know which member contains the bad record and handle it like a sequential data set.

Depending upon your system and the size of the data set, you may be able to use ISPF EDIT to delete the bad record -- but this is not guaranteed to be possible.