Problem solve Get help with specific problems with your technologies, process and projects.

Output a spool file to multiple printers

Follow this easy snapshot to send reports to multiple printers.

You Can View User Feedback To This Tip

Sometimes you need to send a report to multiple printers. Below you'll find code for the CL that I use to send duplicate spool files to different printers. You can add as many duplicates as you like. The one thing to remember is that QSYSPRT, QSYSPRT2, etc. must exist on your system. If it does not, make a copy of QSYSPRT and leave it on your system permanently.

 
CRTPF FILE(QTEMP/DUPRPT)  RCDLEN(133) SIZE(*NOMAX) 

OVRPRTF FILE(QSYSPRT2)  CTLCHAR(*FCFC) OUTQ(your outq)  FORMTYPE(*STD)
COPIES(1) 

CALL PGM(ABC) 
/* printer is your output print file in your pgm */ 

CPYSPLF FILE(PRINTER) TOFILE(QTEMP/DUPRPT) SPLNBR(*LAST) MBROPT(*REPLACE)  
CTLCHAR(*FCFC) 

CPYF FROMFILE(QTEMP/DUPRPT) TOFILE(QSYSPRT2) 

DLTOVR FILE(QSYSPRT2) 
DLTF FILE(QTEMP/DUPRPT) 
MONMSG MSGID(CPF0000)

USER FEEDBACK TO THIS TIP

  • I prefer to use the SNDNETSPLF command and sending it to a local user. I just create a user profile and directory entry for the printers I want to route print to.

    The Send Network Spooled File (SNDNETSPLF) command sends a spooled file to another user on the local system or on a remote system on the SNADS network. The file is placed on the output queue that is specified in the user profile of the user to whom the spooled file was sent.

    When the file arrives at the destination system, a message is sent to both the recipient and sending user notifying them of the arrival of the spooled file.

    See the HELP text of the SNDNETSPLF command for all the details. The description of the SNDNETSPLF command is taken directly from the HELP text for this command as it is stored on the system.

    —Kenneth Graap, Search400.com site expert

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


Dig Deeper on Printing on iSeries

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close