ITEM: H6340L

PRN/TTY Printer not printer correctly


Question:

  I am at 3.2.5 and I have the following setup:

MAINFRAME --------  RISC ========== HP Laser III Printer

On the mainframe, I have an application which sends print jobs
to a local queue on the RISC which then passes it on to the HP III
Laser Printer.  However, these printout are garbled and are not
legible.  This setup has never worked properly but I need it 
working properly.

Response:

You are able to "cat"  a file to the printer device with the command:   
                cat myfilename > /dev/lp\# 

where \# indicates the number associated with your printer device.
Since the cat command worked, we will try to set the virtual printer 
to passthrough mode.  Enter the command "smitty virprt" and then 
select your virtual printer and change these virtual printer 
characteristics:

   _j=!   ;Do not initialize the printer.
   _J=!   ;Do not restore printer at end of job.
   _d=p   ;Input data is passthrough data.
   wp=+   ;Yes, the input stream is to be passthrough data.
   _Z=!   ;Do not send form feeds at end of job, or between pages.

This returned an error 0782-006 mentioning a bad flag "-b"

Edit the file "/etc/qconfig" and look for the stanza name matching
the particular queue that we are using.  In the device stanza 
(The second of the two stanzas for a particular queue.), change
the "file = /dev/lp0" to "file = FALSE" and change the backend
from "piobe" to "/bin/cat" .  However, this failed to produce a printout.  

Since the "-b" flag is an unsupported flag for passthrough printing and 
it cannot be used in conjunction with the "cat" command.  This explains 
why the pass-through mode of the virtual printer was not working.  Also, 
the /bin/cat backend aborts after receiving the "-b" flag which is 
illegal (although it doesn't report it to the user.)

Now, we will write a script to catch all parameters that are being
send to the backend.  First, edit the file "/etc/qconfig" and look 
for the stanza name matching the particular queue that we are using.
in the device stanza  (The second of the two stanzas for a created 
queue.), change the "file = /dev/lp0" to "file = FALSE".  Also, change 
the backend to "/bin/ksh /tmp/catch" which is just a little shell script 
that we will use to trap and observe all the flags being  sent to the 
backend.  The /tmp/catch script looks like the following:

        echo $@ > /tmp/test

The resulting /tmp/test file which is created looks like the following:

-Z + -x 0 -l 6 -b 0 -t 0 -i 0 -p 10 -v 6 -x ibm850 /var/spool/qdaemon/...

Obviously, we see that the lpr command is sending a "-b" and other
flags to the backend.   Essentially, we need only the file that where 
the print job is temporarily stored.  All the other flags are trival or
block the print job from begin printed.  To resolve this situation,
change the /tmp/catch script to the following:

        for f in $@
        do
                echo > /dev/null
        done
        cat $f > /dev/lp0       

At the end of the for loop, the $f variable contains the last word 
from the string stored in $@ which is the temporary file that the 
print job is stored.  This will resolve your problem because it will 
cat the file out to the device without any flags.



Support Line: PRN/TTY Printer not printer correctly ITEM: H6340L
Dated: March 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:47
Comments or suggestions? Contact us