Solved

RUNRMTCMD Printouts

Posted on 2013-01-28
6
959 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
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 34

Assisted Solution

by:Gary Patterson
Gary Patterson earned 150 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 27

Accepted Solution

by:
tliotta earned 350 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 34

Expert Comment

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Learn how the use of a bunch of disparate tools requiring a lot of manual attention led to a series of unfortunate backup events for one company.
Binary Differential Replication, What it is, how it works and how it differs from standard delta file replication
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

813 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

10 Experts available now in Live!

Get 1:1 Help Now