?
Solved

RUNRMTCMD Printouts

Posted on 2013-01-28
6
Medium Priority
?
999 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 35

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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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 35

Expert Comment

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

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 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