To address that problem, I sent a new version (2.0.4) of UNDEL2 to these
two sites:
http://www.think400.dk/downloads.htm
http://dbg400.net/cgi-bin/twiki/view/DBG400/UndelVersion2
(thanks Leif and Martin)
There's a member $CHANGELOG in the SRC file listing changes. The main
ones are:
1. Add a LOCK parm to the UNDEL2 cmd (default *YES) that checks for
locks in other jobs. If there are locks, a window pops up with a
warning and an option to display the locks.
2. Add BAKFILE and BAKMBR parms to UNDEL2 to retrieve data for deleted
records from a backup file.
This is because locks on the file in other jobs (such as when it's open
for update) cause deleted records to appear to UNDEL2 to have default
values (blanks and zeros).
UNDEL2 uses CPYF to copy records to a file in QTEMP, and CPYF uses 'row
copy' in some cases, including when the file is locked, as detailed in
Chuck Pence's msg:
http://archive.midrange.com/midrange-l/200709/msg00543.html
'row copy' copies each record individually and sets fields in deleted
records to default values, which is what UNDEL2 sees.
If there are no locks, CPYF uses 'fast copy' which copies large chunks
of records and doesn't alter deleted records.
If there are locks and you have a backup copy of the file which has the
desired records at the same RRN, either active or deleted, such as a
file restored from a backup tape, you can use the BAKFILE parm to get
the deleted records from the backup file (which is assumed not to be
locked.) Then F23 undeletes records in the main file with data from the
backup file.
--Dave
Mike Krebs wrote:
the file must not be in use. Are there any locks on the file? Does it
work if you do ALCOBJ *EXCL on the member (in the same job) before using
UNDEL2?
I saw Chuck's post and misread (skipped over?) the part about needing an
*EXCL lock. Accounts for why the restored version works and the "live"
version doesn't. I will try it from home one of these nights or weekends.
There is no way that 90% of our live files would be available during the day
for undeleting. Going to have to fall back on the making a copy and using
cpyf to put them back in production.
Mike Krebs
As an Amazon Associate we earn from qualifying purchases.