Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
I remember working with an IBMer a couple years ago on this function. Searching for it is a more accurate description. They basically confirmed that the records are marked with a 1-byte delete code (I think it was an X'FF') and there was no architected method to change that byte.
The only architected method to retrieve deleted records was through Journalling.
Then I saw that both ProData and WRKDBF were doing undelete functions, and thought there must be a round-about way to do an UNDELETE.
What I remember is that so long as the Physical file wasn't RGZPFM'd or REUSEDLT(*YES) is NOT specified, you may be able to go in through a back door and set that byte to non-deleted status (I don't recall if not-deleted is X'01' or something else.)
I also have a faint memory of there being an UNDELETE CL command written in MI (or System C) by someone. I did a search today but didn't see anything on this.
What would be useful is a CL command that was basically like this:
UNDLT FILE(MYLIB/CUSTMAST) MBR(*FIRST) RECORDS( 38 [ 1 ])
Where the RECORDS parameter accepts a range of relative record numbers or a specific record; with the default record count being 1.
Somebody start working on that.