RUNSQLSTM

120 pts.
Tags:
CL
RUNSQLSTM
SQL
am executing a RUNSQLSTM out of a CL program that run a source SQL statement in a source file of a library. Everytime the statement is executed I get a output spool file of the SQL parmeters and execution results. How can I prevent this?

Answer Wiki

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

I don’t know that you can prevent it, but you sure can hide it or kill it :-)

One “hide it” option would be to:
CRTOUTQ TEMP
CRTPRTF TEMP OUTQ(TEMP)
RUNSQLSTM … PRTFILE(TEMP)
and then periodically CLROUTQ TEMP

A “kill it” option would be to, in your CL program, simply DLTSPLF xxx SPLNBR(*LAST) where xxx is the name of your source member right after the RUNSQLSTM command runs successfully.

Bruce Vining
<a href=”http://www.brucevining.com/”>http://www.brucevining.com/</a>
Integrated solutions for the System i user community

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
  • Gilly400
    Hi, It might be worth while to do an OVRPRTF with HOLD(*YES) before your RUNSQLSTM command to make sure that the spooled file doesn't get printed on your default printer. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • TomLiotta
    You might also consider simply not using RUNSQLSTM. Convert it to a QM query and use STRQMQRY instead. You could have much more control over printed output. Tom
    125,585 pointsBadges:
    report
  • SpiderCargo
    DLTSPLF Works fine if only a few RUNSQLSTM's are performed in one job. But if you have many, you will run into a CPF4167 Maximum Spooled Files error! So the real solution should be a way to avoid getting these spooled files.
    10 pointsBadges:
    report
  • Abbey
    [...] RUNSQLSTM [...]
    0 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