Hi,

We have a tool in the TAA Productivity Tools package called RTVDLTRCD.

It saves the file to a save file in QTEMP, reads the save file looking for
deleted records and writes them to the same file name in a separate
library. You may optionally capture the relative record number. After
that, you do your own thing with them.

The tool has some restrictions (no variable length fields, no null fields,
and REUSEDLT(*NO). Obviously, you cannot have reorganized the file.

Al

Al Barsa, Jr.
Barsa Consulting Group, LLC

400>390

"i" comes before "p", "x" and "z"
e gads

Our system's had more names than Elizabeth Taylor!

914-251-1234
914-251-9406 fax

http://www.barsaconsulting.com
http://www.taatool.com
http://www.systemiconnection.com/




"DeLong, Eric"
<EDeLong@Sallybea
uty.com> To
Sent by: "Midrange Systems Technical
midrange-l-bounce Discussion"
s@xxxxxxxxxxxx <midrange-l@xxxxxxxxxxxx>
cc

02/04/2008 10:59 Subject
AM RE: is there a way to recover
deleted records ?

Please respond to
Midrange Systems
Technical
Discussion
<midrange-l@midra
nge.com>






I seem to recall a thread awhile back that revealed that SQL DELETEs cannot
be undone. As I recall, when SQL deletes a row, the record gets
initialized.

http://archive.midrange.com/rpg400-l/200706/msg00495.html

Rereading this thread, it seems the scenario was inconclusive. Anyone know
for sure?

Eric

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of PaulMmn
Sent: Sunday, February 03, 2008 12:34 PM
To: Midrange Systems Technical Discussion
Subject: Re: is there a way to recover deleted records ?


The reason you can retrieve deleted records is that when your program
"deletes" a record, the operating system merely flags that record as
"deleted." That's why DSPFD has totals for "number of records" and
"number of deleted records." Until you reorganize that file, the
deleted record count will continue to climb.

When you save the file (SAVOBJ or SAVLIB), the saved object includes
both the active records and those flagged as deleted.

Now comes the fun part!

Save the file with the deleted records to a SAVF.

You can read a SAVF in RPG. Define a file (I believe it's 528
bytes-- DSPFD for the save file and check) and use it in your program.

As you read the file, there's some header information, followed by
your data. Yes, it doesn't line up with the record boundaries, and
you've got to deal with packed and binary and date fields, but your
records are all there! You can even find the flag that the system
uses to mark deleted records.

It's left as an exercise for the student to unwind the spanned
records and copy them to a new file with the deleted records restored.

Isn't there an option when dealing with files in the IFS to tell the
transfer commands what the record length is? If so, a copy out and
back may re-align the records...

-Paul E Musselman
PaulMmn@xxxxxxxxxxxxxxxxxxxx
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.