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
@Charlie:Please explain more abt the SQ query..
Thanks andk Regards
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
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.
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
Thanks to all ….
this info is really helpful…
u guys are simply genius in AS400…
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
In the ‘use with caution’ category you may wish to read about ‘Re-use deleted records’ as a file attribute.
You could use the qusrmbrd api to retrieve this information.
Format xxxx0200 I believe.
John