Want to delete objects of type ‘File’ except ‘source physical file’

100 pts.
Tags:
AS/400 Database File
AS400 physical file
Database Files
DSPOBJD
Physical Files
I have taken output of DSPOBJD in a database file. Now I want to delete all the objects having type '*FILE' and object attribute 'PF' but the problem is I don't want to delete 'Source physical files'. I just want to delete files except 'Source physical file'. can anybody suggest how to do that ?

Software/Hardware used:
as400

Answer Wiki

Thanks. We'll let you know when a new response is added.

A source file should have an attribute of PF-SRC
So first you would need to delete LF objects, then PF objects.
If there is on a single library or two, the easist way without doing any coding is using a User defined PDM option.
If you do WRKOBJPPDM xxxx where xxxx is your library name.
Then F16, here you can create a PDM option. Like DF DLTF &L/&N
Then Enter
Then F17 and use the filter option to get just the LF objects
Now put DF in the first subfile option
F13 to repeat to the end
Enter
-
Next go back and change your filter from LF to PF and repeat.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    A PDM user option is a good choice. One minor adjustment: change your filter from LF to PF and repeat. The filter should be changed to PF-DTA in order to differentiate between source (PF-SRC) and data (PF-DTA) physical files. The filter would have Object Type of *FILE for both runs. The change would be to the 'Object attribute' portion of the filter. The PDM method lets you see the list of objects before you run any "delete" operation. That helps because you can experiment with different filters to see what objects are selected before actually doing anything to them. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Also, it's not actually necessary to create a user option for this. PDM is aware of *FILE objects and the various 'Object attributes' that are associated with them. A normal PDM option 4='Delete' can be used. And note that you can put a "4" in the option field for any item and then press F13. That tells PDM to duplicate the option number into every item on the list that follows you one you typed into. After that, you could even scroll down through the list and remove some of the "4"s before pressing <Enter> if you wanted to make minor adjustments. Tom
    125,585 pointsBadges:
    report
  • Splat
    If you need to do this using an output file, you'd best be served by using DSPFD FILE([file library]/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) OUTFILE([outfile library]/[outfile]) then selecting those records where ATDTAT = 'S'.
    7,055 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following