CAN I REDIRECT PRINT FROM LPD TO A FILE?

ITEM: RTA000037591



QUESTION:                                                                       
My customer is currently hardcoding passwords for FTP on their                  
MVS JES job so as to send data via FTP to AIX FTP user.  They would             
like to eliminate the passwords, so I suggested that they consider              
LPR/LPD.  I thought that maybe you could code the LPR request in                
the JCL and have it execute the print job to the LPD function                   
at the AIX RS/6000.  However, they just want to route the data to a             
file - not to a printer.  Is this possible?  Can we redirect a                  
dummy printer to a file and use it as the file?  I suppose we                   
might need to do some massaging to get rid of imbedded print                    
characters but I thought it was worth investigating.                            
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
A: Yes, it is possible to redirect items submitted to the .print. queue         
   to file.  It is also possible to do so without the embedding of any         
   printer codes.  The method for doing so involves creating a new print        
   queue which is not associated with any real printer and which uses the       
   "backend" of your choice (which will do the redirecting).                    
                                                                                
   Below I have outlined the steps.  Please note, since this process            
   involves using a custom backend, this queue will not be supported by         
   IBM.                                                                         
                                                                                
   Step 1.  Create a new print queue.                                           
                                                                                
      - As root, enter the following command and fastpath to start smit:        
                                                                                
          smit mklque                                                           
                                                                                
      - In the "Name of queue to add" field, enter a name for the print        
        queue (call it anything you like).                                      
                                                                                
      - In the "NAME of device to add" field, enter a name for the              
        device to add.  You may call the device anything you like.  You         
        may wish to give the device name the same name as the queue.            
                                                                                
      - In the "BACKEND PROGRAM pathname" field, enter the absolute             
        pathname of a script which you will be creating in the next step        
        You may place this script anywhere which you like, although             
        placing it in the /usr/lpd directory would be advisable.  For           
        example, you may wish to enter "/usr/lpd/mybackend" in this             
        field.                                                                  
                                                                                
      - Ensure that "Print HEADER pages?", "Print TRAILER pages?", and          
        "ALIGN pages between files within jobs" are set to "NEVER" (or         
        "NO").                                                                  
                                                                                
      - Select "Do."                                                            
                                                                                
   Step 2.  Create the new backend.                                             
                                                                                
      - Create a script which has an absolute pathname the same as that         
        entered in the "BACKEND PROGRAM pathname" field above.  For             
        example, create a script with the name "mybackend" in the               
        "/usr/lpd" directory.  A sample script which simply sends all           
        jobs submitted to that print queue to a file "/output" is               
        provided below.                                                         
                                                                                
        Please note, AIX Technical Support does not do programming or           
        script writing services.  The script below is a sample script          
        and is in no way supported by IBM.  It is provided to guide you         
        in the creation of your own script.                                     
                                                                                
           #¢ /bin/ksh                                                          
                                                                                
           cat $1 > /output                                                     
                                                                                
         In case your printer is unable to print any of the above               
         characters, the first line reads "pound, exclamation-mark,             
         space forward slash, bin, forward slash, ksh."  The second             
         line reads "cat, space, dollar sign, 1, space, greater-than,           
         space, forward slash, output."                                         
                                                                                
         When the backend is called, the first command line parameter           
         ($1) will be the absolute pathname of the file to be "printed"        
         most probably located in a spool directory.  This example              
         slimply copies that file to the desired file.                          
                                                                                
   The result of this procedure is that an exact replica of whatever is         
   submitted to the print queue is sent to the file "/output".  To allow        
   users on other machines to access this print queue, simply define it         
   as a remote printer queue as normal.                                         
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
                                                                                
                                                                                
This item was created from library item Q650473      CNTWT                      
                                                                                
Additional search words:                                                        
CNTWT COMMUNICATIO FILE FILES IX JAN94 LPD OZNEW PRINT PRINTABLE               
PRINTER PRINTING PRT REDIRECT RISCSYSTEM RISCTCP SOFTWARE TCPIP                 
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RTA000037591 ITEM: RTA000037591
Dated: 04/1996 Category: RISCPRT
This HTML file was generated 99/06/24~12:43:14
Comments or suggestions? Contact us