Solved

RUNRMTCMD Printouts

Posted on 2013-01-28
6
937 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 350 total points
Comment Utility
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
Comment Utility
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 34

Assisted Solution

by:Gary Patterson
Gary Patterson earned 150 total points
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 27

Accepted Solution

by:
tliotta earned 350 total points
Comment Utility
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
Comment Utility
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 34

Expert Comment

by:Gary Patterson
Comment Utility
Nice solution.  Thanks for posting back with it.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now