Tip

Distribute spool files to printers easily

You Can View User Feedback To This Tip

Wouldn't it be nice to have a "simple" process for distributing copies of spool files to different printers? Or one that just uses basic OS/400 commands and definitions?

Well, you can, with just a few simple user profiles, distribution entries and the SNDNETSPLF command.

Here are the pieces:


Kenneth Graap

  1. The SNDNETSPLF command, which is designed to send copies of spool files to System Distribution Entries.

    OS/400 HELP defines the System Distribution Directory as: A directory containing information about a user, such as the user ID and address, system name, user profile name, mailing address, telephone, number, and other user information.
  2. User profiles to identify each printer you want to distribute to.
  3. Local directory entries associated with specific user profiles.

Say we have 20 printers spread around the company, and we want to be able to route copies of spool files to anyone of them.

In this example, each print writer has an output queue associated with it that has same name as the print writer.

Here is what you can do:

  1. Create a user profile for each printer. This user profile has no special authority, and you can't us it to initiate an interactive session. It is just created so the SNDNETSPLF can identify where to deposit the spool file copy:
            CRTUSRPRF   USRPRF(PRT01)
                               PASSWORD(*NONE)
                               INLMNU(*SIGNOFF)
                              TEXT('Route print to PRT01')
                              OUTQ(QUSRSYS/PRT01)      
    

  2. Add a System Distribution Entry for each one of these profiles:
            ADDDIRE USRID(PRT01 PRINTER)
                           USRD('Route print to PRT01')
                               USER(PRT01)    
    

That's all there is to setting it up. When the SNDNETSPLF command is used, it will package up an exact copy of a spool file and send it to the output queue defined for the user profile associated with the System Distribution Entry you specify.

To send a copy of a spool file to a printer you could do any of the following.

Use Option 1 (Send) from the WRKOUTQ or WRKSPLF display and hit F4 to prompt.

                             Work with Output Queue

                                                     
 Queue:   KENNETH        Library:   KENNETH        Status:   RLS                
                                                                                
 Type options, press Enter.                                                     
   1=Send   2=Change   3=Hold   4=Delete   5=Display   6=Release   7=Messages   
   8=Attributes        9=Work with printing status                              
                                                                                
 Opt  File        User        User Data   Sts   Pages   Copies  Form Type   Pty 
      QPRINT      KEG         PRTDBFANL   RDY     259       1   *STD         4  
      QPSAVOBJ    KEG                     RDY       1       1   *STD         5  
      QPSRLDSP    KEG                     RDY       1       1   *STD         5



                          Work with All Spooled Files

                                                                                
 Type options, press Enter.                                                     
   1=Send   2=Change   3=Hold   4=Delete   5=Display   6=Release   7=Messages   
   8=Attributes        9=Work with printing status                              
                                                                                
                                                                                
                              Device or                     Total     Cur       
 Opt  File        User        Queue       User Data   Sts   Pages    Page  Copy 
      QPJOBLOG    KEG         QEZJOBLOG   QZDASOINIT  RDY       5             1 
      QHSTANL     KEG         QHSTANL     083103      RDY       8             1 
      QHSTANL     KEG         QHSTANL     090103      RDY       8             1 

Specify the System Distribution List entry for one of the printers as TOUSRID (PRT01 PRINTER) ....

Hit enter, and away it goes.

You can also put a " + for more values " and enter a list of printers to send copies to.

                     Send Network Spooled File (SNDNETSPLF) 
                                                            
 Type choices, press Enter.                                 
                                                            
 Spooled file . . . . . . . . . . FILE         > QPJOBLOG   
 User ID:                         TOUSRID        PRT01      
   User ID  . . . . . . . . . . .                PRINTER    
   Address  . . . . . . . . . . .                           
                           + for more values                
 Job name . . . . . . . . . . . . JOB          > QPRTJOB    
   User . . . . . . . . . . . . .              >   KEG      
   Number . . . . . . . . . . . .              >   899613   
 Spooled file number  . . . . . . SPLNBR       > 6204       
 Job system name  . . . . . . . . JOBSYSNAME   > S02        
 Spooled file created:            CRTDATE                   
   Creation date  . . . . . . . .              > '10/20/03' 
   Creation time  . . . . . . . .              > '09:18:16' 
 Data format  . . . . . . . . . . DTAFMT         *RCDDATA   
                                                            

In a CLP you would just use the SNDNETSPLF command with a single user ID or list of User IDs:

        SNDNETSPLF FILE(&FILENAME)
                TOUSRID((&USER &ADDRESS))
                JOB(*) 

Don't limit yourself to sending just to printer IDs either. You can specify any System Distribution Entry, so you can send spool file copies to output queues associated with any user profile on the system or to users on remote iSeries systems if you have a SNADS network set up.

Example: To send a copy of a spool file to writers PRT01, PRT02 and to myself

        SNDNETSPLF FILE(myfile)
                TOUSRID((prt01 printer)(prt02 printer)(keg s02))
                JOB(*) 

There ya go. See how simple this is. AND there is no need to copy spool file data into a database file and then turn around and recreate the file. OS/400 takes care of everything.

I hope you find this to be as useful in your everyday working environment as I do in mine.

---------------------------
About the author: Kenneth is a senior AS/400e system administrator at Northwest Natural Gas in Portland, Ore. He has extensive experience in all aspects of iSeries systems management. That includes proactive performance tuning, system software upgrades and maintenance, hardware upgrade planning, backup/recovery procedures and security.

==================================
MORE INFORMATION
==================================

USER FEEDBACK TO THIS TIP

  • I've used SNDNETSPLF for years to good effect. But for simplicity, SNDTCPSPLF can often be better as long as you only need what it supplies. — Thomas Liotta


This was first published in October 2003

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.