Solved

files with deleted records - flag ?

Posted on 2007-03-20
4
494 Views
Last Modified: 2007-12-19
Exists there a flag (or somthing else) to  identify files with  deleted records ?
DSPRFD with (*MBR) is little bit too expensive . . .
0
Comment
Question by:asdf13
  • 2
4 Comments
 
LVL 14

Assisted Solution

by:daveslater
daveslater earned 60 total points
ID: 18755467
Hi
you can use the RTVMBRD with the NBRDLTRCD parm

Dave
0
 
LVL 27

Accepted Solution

by:
tliotta earned 65 total points
ID: 18758627
asdf13:

I'm not sure why DSPFD *MBR to an *OUTFILE would be too expensive, but the various file APIs are the general alternative.

1. Create a list of the files you want to check.
2. For each file:
3. Call QUSLMBR to list the files members in a user space.
4.    For each member:
5.     Call QUSRMBRD with format MBRD0200
6.     Check number of deleted records in positions 145-148 for a zero/non-zero 32-bit binary number.

If you only want to check a single file, you don't need to create a list of files. And if the file only has a single member, you don't have to create a list of members.

In fact, if it's a single file with a single member, you can retrieve the value directly with QUSRMBRD. The API essentially does just the same as the RTVMBRD command that Dave suggested.

The QUSLOBJ API can be used to create a list of *FILE objects. If the list cannot be filtered to a small enough number to fit in a user space, the QGYOLOBJ API can supply the list dynamically.

Please elaborate on why DSPFD *MBR is too expensive. There might be ways to use it that can help.

Tom
0
 

Author Comment

by:asdf13
ID: 18765439
Hello,
thanks for recommendation.
My intention was,  to save systemresources (performance).
Big libraries, with many files   and up to 32.000 members, takes a lot of processing time with DSPFD or RTVMBRD.  ("too expensive . . . ")
Now i  got the information, that  in former releases (<V5), a "inofficial" API  delivered the flag "contains deleted records". But this API doesn't exits yet.
 
0
 
LVL 27

Expert Comment

by:tliotta
ID: 18766223
asdf13:

Ouch.

So many members... some ERP or similar app creating them?

Unusual elements get involved when member counts start to grow. One example is that authorities get stored with _each_ member. This is because members are actually objects themselves although we don't program for that -- we program as if the *FILE is the object. You can see this in action when you do something like CHGOBJAUT for a *FILE with many members; it can take a long time for the command to complete as each member gets touched behind the scenes.

That kind of overhead can drain a system (as you probably experience at times). Elimination of excess members can really pay off.

Good luck.

Tom
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

While it may be true that the internet is a place of possibilities, it is also a hostile environment lurking with many dangers. By clicking on the wrong link, trusting the wrong person or using a weak password, you are virtually inviting hackers to …
Adults who share images on social media aren’t the only ones who need to worry about their privacy. Our culture’s tendency to share every move and celebration affects the privacy of our children, too.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question