Clear AS/400 library

350 pts.
Tags:
AS/400
AS/400 Library
AS/400 Object Cleanup
AS/400 objects
library1                                 library2 pf1                                       lf3 lf1 lf2 i have 2 librares but i want to clear library1 all objects but not clear because depent objects are there in library how to clear all objects in library1, give me advices  

Software/Hardware used:
software

Answer Wiki

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

I run a CL every week to let me know if I have any LF not in the same library as the PF.
Here is what I do.
<pre>DSPDBR FILE(*ALL/*ALL) OUTPUT(*OUTFILE) +
OUTFILE(QTEMP/BAD_LF)

RUNQRY QRY(PGMRTOOLS/CROSS_LF)

Then I send the report as an email attachment.

—-

Here is the Query
Sleect fields
Seq Field
10 WHRTYP
20 WHRFI
30 WHRLI
40 WHRMB
50 WHNO
60 WHREFI
70 WHRELI
80 WHREMB
90 WHTYPE

Select Records
AND/OR Field Test Value (Field, Num
WHRELI NE WHRLI
AND WHRELI NE ‘ ‘
AND WHRLI NLIST ‘QSYS2′ ‘QSYS’</pre>

Discuss This Question: 7  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
  • Mariodlg
    It is not clear for me exactly what do you need, but I think you could save the file dependencies in a file and then read it from a program to clear the object that has no dependencies. You can use DSPDBR command to see database dependencies and save this output to a file. Like this: DSPDBR FILE(MYLIBRARY/*ALL) OUTPUT(*OUTFILE) OUTFILE(QTEMP/MYFILE) MBR(*NONE) Regards.
    2,790 pointsBadges:
    report
  • TomLiotta
    The simple answer is that you cannot delete pf1 from library1 until you first delete lf3 from library2. The system won't allow pf1 to be deleted until its dependent files are deleted. You could move lf3 into library1 and then clear library1. You might use the MOVOBJ command to do that. Tom
    125,585 pointsBadges:
    report
  • deepu9321
    Hi, You couldnt be able to clear(or delete) Physical file when there was logical file existing based on PF. Either you need to delete LF in Library 2 and should try clearing LIbrary1 (or) Move the LF from Library2 to library1 and try clearing Library. Pradeep.
    3,910 pointsBadges:
    report
  • madhuchowdary
    thanks your guidelines
    350 pointsBadges:
    report
  • madhuchowdary
    [...] A member looking to clear out a library in AS/400 received some help from CharlieBrowne, Mariodlg, TomLiotta, and [...]
    0 pointsBadges:
    report
  • Bo
    When questions like this.............Don't forget about the QADB* files in QSYS (In this case QADBFDEP)
    35 pointsBadges:
    report
  • TomLiotta
    Don’t forget about the QADB* files in QSYS (In this case QADBFDEP) Those files should be forgotten. I don't know of a reason ever to access them, and there is good reason not to. Those are system files that should be left alone for DB2 to use. IBM has provided a number of alternative interfaces that are much better choices. Use the supplied interfaces. The DSPDBR command is one simple interface. The views, SYSVIEWDEP and SYSTABDEP in QSYS2, are another. And the List Database Relations (QDBLDBR) API is still another. When directly accessing DB2 system files, there's an elevated risk of getting the database cross-references out of sync. That leads to the need for RCLSTG SELECT(*DBXREF) or RCLDBXREF. Tom
    125,585 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