QTEMP file not removed

30 pts.
Tags:
AS/400
iSeries
QTEMP
In my CLP I created a file in QTEMP using CRTDUPOBJ. I then use this file in a few CL programs and a couple of RPG programs. Also, in OPNQRYF in the CL programs. At the end of the job stream my file is not removed. I have used QTEMP before without a problem; I'm wondering if using it in OPNQRYF has something to do with the problem, or maybe the file name vs label (or override name). Below is just a few lines of code from a couple of the CL pgms. "CRTDUPOBJ OBJ(TSLSSUM) FROMLIB(QS36F) OBJTYPE(*FILE) + TOLIB(QTEMP) NEWOBJ(TSS1580) " "OPNQRYF FILE((QTEMP/TSS1580)) + KEYFLD((SMCOMP) (SMSLSP) (SMCSNM) (SMITEM))" "OVRDBF FILE(TSLSSUM) TOFILE(QTEMP/TSS1580) SHARE(*YES)" "CALL PGM(SOLID/SS1580) PARM(&COMP &ALPH &SEQ + &SLSP &TOLY &TODT)" "DLTOVR FILE(*ALL) " "CLOF OPNID(TSS1580)" Thanks for any help.

Software/Hardware used:
AS400

Answer Wiki

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

Objects stay in QTEMP until they are deleted, moved, or the job ends.

So if you run in batch or sign off your interactive job, the objects will disappear. If you run interactive and keep that job open the objects will still be there. If the CL is to be run interactive, you must to a DLTF in your CL.

Discuss This Question: 4  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
  • philpl1jb
    Perhaps you should add DLTF TSS1580 at the end of your code.
    49,435 pointsBadges:
    report
  • aceofdelts
    Or DLTF at the start of your code (with a MONMSG)
    1,850 pointsBadges:
    report
  • TomLiotta
    At the end of the job stream my file is not removed.   Please define what you mean by "At the end of the job stream...". There are multiple ways that your programming might run, and the different ways will have different "end of job stream".   You might call the programming directly from a command line or menu option. In that case, the end of the job stream will happen when you sign off of the interactive session.   You might use a SBMJOB command to submit the job to 'batch'. If so, the end of the job will happen essentially when the program ends.   Or you might call the program remotely through the Remote Command server or as a stored procedure through the database server. If so, the end of the job will happen when that server instance ends. That might or might not coincide with the ending of your program.   If there are any circumstances when the end of your program does not coincide with the end of the job, and you need to ensure that the file is gone, then you should use DLTF at the end of your program. Technically, whenever a resource is no longer needed, it should be deleted whether in QTEMP or not.   Tom
    125,585 pointsBadges:
    report
  • Rpgldb
    Thanks for all the responses. Yes, I knew that I could delete the file, but I was curious as to why it wasn't automatically deleted. It turns out that because I was running the job as a test I was calling the first CLP from the command line, then that CLP called the next CLP. All of this was interactive. For some reason I wasn't thinking about the fact that because I was interactive my session itself is the "job" and therefore the file would not be deleted while I was still on my session.Thanks again for all your input.
    30 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