80 EFS Systems on a Linux Base: Additional Topics
and converts the data to ASCII. In our FLEX-ES resources definition, we specified a fixed
Linux file name, /tmp/print.out, as the destination for the 1403 at address 00E.
The 1403 emulation program accepts whatever data is written to the 1403 and adds it to the
Linux output file. There may be many z/OS jobs in the file, with the separator pages
generated by JES2. The emulation program cannot detect z/OS job boundaries, although
some crude filtering is possible based on the content of JES2 separator pages. This output
file will grow indefinitely until you clear it.
We created the shPRT shell script. This shell script sends printer control characters and the
print data to the lpr command. The lpr command, in turn, sends the data to a Linux print
queue where it is handled by the print daemon. The result is output that looks very much like
line-mode output from a 38xx printer.
6.4.2 Implementation
There are a number of steps required to implement this process. These include:
Connect an appropriate printer to the server and Linux
Define a Linux raw print queue
Create the shPRT shell script
Define a 1403 printer in the FLEX-ES resources
Define a 1403 printer for JES2, if not already done
Understand the operational steps needed to use this process
Printer and print queue
We simply connected our Lexmark Optra L printer (with the duplex feature) to the parallel port
on our EFS system and rebooted the system. If the printer had not been connected before,
Linux offers to configure it for you. After doing this, we then used a Red Hat tool (under gnome
in RH 8.0 it is found with System Settings-->Printing) to configure a print queue. In this tool:
Select New (followed by forward to move through the panels).
Select a local printer and define the queue name as
rawprint (this is an arbitrary name).
The device is /dev/lp0 (and our Linux automatically detected the Lexmark printer).
Select the print driver as Raw Print Queue. (Do not select any of the specific printer
names.)
Select the Apply option. This should restart the lpd daemon.
Exit from the printer configuration tool.
Shell script
We created our shPRT shell script in the /usr/flexes/rundir directory where we keep all our
FLEX-ES operational files. The shell script contains:
CTL=”\033\105\033\050\163\060\160\061\066\056\066\067\150\070\056\166
\060\163\060\142\124\033\046\154\061\157\061\163\065\056\064\143
\055\061\060\060\060\132”
CTL2=”\014\033\105”
(/bin/echo -ne $CTL; cat /tmp/print.out; /bin/echo -ne $CTL2) | lpr -P rawprint
echo ‘Sent to print queue - Remember to “load 00E” ‘
The CTL and CTL2 constants are printer control characters, written in octal.
54
The octal
format was the most convenient for use in a shell script. If you have good script writing skills
you can do this many different ways. The particular control characters shown here are for the
54
CTL is shown as three lines here, but it is actually created as one long line containing 38 octal constants.