670 pts.
 Getting the number of deleted records from Physical file
My requiremnt is to get the number of deleted records from a physical file. This will clear more.When we give DSPFD File name, at bottom we can see the number of records deleted from the so how to pull that field which consist of the value of number of deleted records

Software/Hardware used:
AS400
ASKED: September 28, 2011  6:18 PM
UPDATED: March 31, 2012  1:03 AM

Answer Wiki:
Use the DSPFD command with TYPE(*MBRLIST) OUTPUT(*OUTFILE) Then you can use SQL, Query, or a program to get the information
Last Wiki Answer Submitted:  September 28, 2011  6:29 pm  by  rpgfreeer   85 pts.
All Answer Wiki Contributors:  rpgfreeer   85 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

@Charlie:Please explain more abt the SQ query..

Thanks andk Regards

 670 pts.

 

Charlie Brown suggested using the DSPFD command to create an outfile.
Then use whatever tool you are conforatable with to view / report on the file tht you created. One of the fields will have the text ‘Deleted Records’
Phil

 44,630 pts.

 

As Philp explained with what I suggested, you have a new file that contains the deleted record counts. You can use the file in what ever way you desire.
If you still need assistance, you will have to give us more information as to what you are trying to do.

 33,695 pts.

 

For a specific file, simplest might simply be to use the RTVMBRD command in a CL module:

RTVMBRD FILE(MYLIB/MYFILE)   +
        NBRDLTRCD(&NBRDLTRCD)

Declare the receiver variable as *DEC (10 0).

If it’s for many files, such as all files in a library, simplest is probably CharlieBrowne’s suggestion.

As for explaining queries, first you should describe your programming background and also give some context on the need for handling the number of deleted records. There can be risks in giving programming advice without knowing how it will be used. If there isn’t enough background knowledge, programming can mess up a system fast.

Tom

 110,115 pts.

 

Thanks to all ….
this info is really helpful…
u guys are simply genius in AS400…

 670 pts.

 

Be aware that if this programming is intended to automate RGZPFM to reorganize files with deleted records, it may be very risky. It’s possible that such a program should not be run.

Without being familiar with the system and with each file, there is no way to know.

Tom

 110,115 pts.

 

In the ‘use with caution’ category you may wish to read about ‘Re-use deleted records’ as a file attribute.

 5,505 pts.

 

You could use the qusrmbrd api to retrieve this information.

Format xxxx0200 I believe.

John

 245 pts.