Logical Files error

5 pts.
Tags:
AS/400
We are receiving an error "File TQRYOUT in QGPL has logical files, cannot replace." which is preventing us from running some of our month-end queries. Please provide some suggestion as to what do we need to look at to correct this. Thank you

Answer Wiki

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

Assuming this file is generating during month-end processing by the execution of a standard OS/400 query, it sounds like the query output option is set to regenerate the entire file every time. You can change that so it simply replaces the contents within the file. Or you could add a simple CL program to run in front of the query that finds all of the logicals that reference this file and delete them. But then you’d have to recreate them (if they were needed) after the query has finished running. Your choice.

============================================================

To generate a list of dependent files, you might run this command:<pre>
DSPDBR FILE( QGPL/TQRYOUT ) OUTPUT(*OUTFILE) OUTFILE( QTEMP/TQRYOUTLF )</pre>
That would create a small file in QTEMP that could be read by a CL program. The dependent files could each be deleted with a DLTF command.

If you simply want to see the list, use OUTPUT(*) instead. You might want to track down whatever (or whomever) is creating these.

Tom

Discuss This Question:  

 
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

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