40 pts.
 AS/400 Program To List Physcial Files with Deleted Records
We currently have a program to list Physical Files with Deleted Records. The CLP utilizes the DSPFD command to build an out-file. The parameter for 'Type of Information' is *MBRLIST and 'File Attributes' is *PF. However, the out-file lists the data at the member level. Also, teh job takes TOO LONG to execute.

Rather then build a program to consolidate the data up to the physical file level, I want to know if threre is a command or API to list all the physical files in the system with deleted records ? The list must not be at the member level.

Thanks in advance.

 



Software/Hardware used:
i5/OS V5R4M0
ASKED: November 3, 2009  9:32 PM
UPDATED: November 6, 2009  12:02 AM

Answer Wiki:
There is nothing that I am aware of to do what you want in one step. Why does it take TOO LONG? How long does it take? Are you doing all libraries? A simple CL program with the DSPFD command outputting to a file in QTEMP, then running an SQL or QRY after that to get your short list would be easy to create. You can then schedule that job to run in the early hours of the morning so you have the results when you come in.
Last Wiki Answer Submitted:  November 3, 2009  10:44 pm  by  CharlieBrowne   33,695 pts.
All Answer Wiki Contributors:  CharlieBrowne   33,695 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

If your goal is to run RGZPFM you’re going to need the member name anyway.
Phil

 44,630 pts.

 

I think the API’s you want to take a look at are QUSLOBJ (to get the list of PF into a user space) , QUSLMBR(to get a list of members) and QUSMBRD (to get the info about the member). I found that going with API’s is way faster than using the CL commands with output to a file. Using these APIs you can build your own file with files having deleted records.

 2,280 pts.

 

The APIs at Work Second Edition book (note that I’m the author so this is somewhat a vendor response) contains several sample programs that find the files/members with deleted records exceeding a user specified percentage of records and optionally reorganizes the members.

Bruce Vining
Bruce Vining Services

 6,055 pts.

 

I’d suspect that first you really only want PF-DTA (data files) while ignoring PF-SRC (source) files.

Data files will tend to have only single members while source files will tend to have many members. Further, it’s a near certainty that you won’t be caring about deleted records in source files; so there’s almost no reason to include them.

It’s possible (likely?) that running DSPFD individually against only data files might make a significant difference.

However, there’s not enough info in the question to make a suggestion. Without knowing what “the set” of files is that DSPFD is run over, everything is guesswork.

Can you at least tell us what the DSPFD runs against? What files does it request?

Also, does the program merely ‘list’ the members with deleted records or does it do something with the records from the *outfile?

Tom

 110,115 pts.