× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



It's possible to write a CL program that calls UNDEL in a loop. UNDEL
takes a relative record number as a parameter and all you need to do put
it in a loop and increment a counter. I think it returns a message that
kills the program when you try to undelete a record that isn't deleted
but MONMSG will handle that. Here's an example CL:

PGM
DCL VAR(&RRN) TYPE(*DEC) LEN(6 0) VALUE(1)

START:
UNDEL FILE(TPCHAASM/F57EMAIL) RCDNBR(&RRN) +
ACTION(*RTV) OUTPUT(*OUTFILE) +
OUTFILE(TPCHAASM/EMAILOUT) OUTMBR(*FIRST +
*ADD)
MONMSG MSGID(TOL0001 TOL0020)
CHGVAR VAR(&RRN) VALUE(&RRN + 1)
IF COND(&RRN < 46315) THEN(GOTO CMDLBL(START))

ENDPGM

I will warn you that UNDEL isn't fast but it works great.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Douglas Handy
Sent: Friday, May 18, 2007 2:23 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: undeleting deleted records


If memory serves correctly, Dave McKenzie came up with it,
and you can read all about it just by searching for UNDEL
in the MI400 and MIDRANGE-L archives.


He did, although it did one record at a time. UNDEL was also used under
the
covers by WRKDBF to undelete specific records. WRKDBF also included a
command WRKDBFUNDL which did a global undelete of an entire file, by
cycling
through the file and using UNDEL on each deleted record.

However, WRKDBF is not longer available so unless you already have a
copy,
you should look at other alternatives.

Doug

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.