?
Solved

RUNRMTCMD Printouts

Posted on 2013-01-28
6
Medium Priority
?
1,026 Views
Last Modified: 2013-01-30
According to the IBM manual, when using RUNRMTCMD, "the command is sent to the remote system, the local system waits for the command to complete and the output from the remote command will be placed in a spooled file."  Is is there any way to stop RUNRMTCMD from creating a spool file each time it is run (ideally be able to turn the printing back on when debugging a problem.)?
0
Comment
Question by:doninh
  • 2
  • 2
  • 2
6 Comments
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 1400 total points
ID: 38830200
Are you asking about the spooling of the print file or the printing of it? The printing can be avoided by a simple OVRPRTF. The spooling would be trickier.

Tom
0
 

Author Comment

by:doninh
ID: 38831301
Thank you for responding, Tom.   Ideally I would like to not have a spool file created at all, however, if that isn't possible, then I guess I could use OVRPRTF and have the spool file created in an output queue created for just this purpose.  Then after the job has finished, clear the output queue.  Then only thing I'm not sure of is how to specify the spool file before the RUNRMTCMD is executed.
0
 
LVL 36

Assisted Solution

by:Gary Patterson
Gary Patterson earned 600 total points
ID: 38831963
With RUNRMTCMD, the spooled file is actually created on the remote system, and then sent to the local system, so I don't think OVRPRTF on the local system will help.
 
I don't know of any way to "turn off" this behavior, at least not using the CL RUNRMTCMD command.

I'd suggest that you just delete the spooled file right after it is created on the local system.

If the spooled file is owned by the local job containing the RUNRMTCMD, you could just do this:

RUNRMTCMD ...
DLTSPLF FILE(...) SPLNBR(*LAST)

If the spooled file is owned by a QPRTJOB job, then things are a little trickier, and you first need to find the name of the spooled file in order to explicitly delete it.  Here is an article that discusses the options.  I recommend the QSPRILSP API approach:

http://www-01.ibm.com/support/docview.wss?uid=nas145751e5b298957558625713b0053b33e

One last note:  It is also possible to create a program or command on the remote system that intentionally "breaks" the RUNRMTCMD's ability to capture the remote spooled file and send it back.  If you are running a user-defined command or using RUNRMTCMD to run a remote CALL, then you could use this approach, but you'll also have the same spooled file cleanup job to do- just on the remote system instead of the local system.

- Gary Patterson
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 27

Accepted Solution

by:
tliotta earned 1400 total points
ID: 38833556
AFAIK, OVRPRTF does work. I'm not aware that the spooled file is created and sent, but that the data is returned and then spooled. I haven't actually checked the mechanism, but the override to QSYSPRT (often for HOLD(*YES)) does work. Under at least some circumstances, an override needs to be SECURE(*YES) because RUNRMTCMD does its own internal override.

Tom
0
 

Author Closing Comment

by:doninh
ID: 38836808
I've been able to avoid having the spool file print using OVRPRTF to QSYSPRT (sending spool file to an output queue with no attached printer) just before executing the RUNRMTCMD command.  (I created the output queue to be used just for this purpose.)  Immediately after the RUNRMTCMD is finished I delete the override.  The CL program loops and the RUNRMTCMD can be executed multiple times.  Then just before the the CL program ends, I clear the output queue containing the spool files that were created each time the RUNRMTCMD was executed.  It's now in production and the users are happy not to be getting 'meaningless' reports printing on their printers any more
Thanks for the great responses.
0
 
LVL 36

Expert Comment

by:Gary Patterson
ID: 38836933
Nice solution.  Thanks for posting back with it.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Currently, there is an issue with being able to copy values from an external application to a dropdown list in Project Web Access (PWA).  The standard copy and paste methods don't seem to work properly. Here is a way to accomplish this task to s…
Integration Management Part 2
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question