LPR for JobPak
Introduction
LPR for JobPak is an easy-to-use, command line program that sends spoolfiles from
your HP3000 to Unix, Linux, and Windows printers using the Line Printer Daemon protocol.
Virutally any device or system that supports LPD can be sent to.
To be able to send a spoolfile with LPR for JobPak, the program must be given this
information via command line arguments:
- Spoolfile ID or filename
- Hostname or IP address of the destination system
- Printer name on the destination system
Normally, the LPR program is run from a command file that is executed by the JobPak
job. However, it may be run from an MPE prompt, or built into your JCL. It does
not need to be run from the NSD account and requires no special capabilities.
Example Command Usage
LPR.JPAK.NSD "1234 PC123 LASERJET1"
Or
LPR.JPAK.NSD "O1234.OUT.HPSPOOL PC123 LASERJET1"
The above commands send spoolfile #O1234 to a system named PC123 to print on that
system's printer named LASERJET1.
Note that only spoolfiles in OUTSP format may be sent. If the spoolfile being sent
is linked into the spool system then it may be referenced by either its spool ID
number, or by its Onnn.OUT.HPSPOOL filename. Unlinked spoolfiles (residing in any
group or account) may only be referenced by the complete filename method.
Output Format
The LPR program on the HP3000 does not alter the spoolfile print data, it simply
reads it from the spoolfile and sends it to the destination system. The data is
sent "raw", and whatever control codes may or may not be embedded in the spoolfile
are passed on to the destination. LPR correctly interprets MPE spoolfile charactersitics,
like top-of-form, automatic 60 or 66 line pages, pre- and post-spacing directives,
line-spacing carriage control, and VFC initialization files. However, be aware that
if the spoolfile data contains PCL escape sequences for a LaserJet, the spoolfile
is not going to print correctly when sent to a printer that supports only Postscript.
Reports that contain only MPE carriage control will print correctly on most any
printer.
Printer Names
In most cases the destination printer name used on the LPR command line is case-sensitive
when the remote system checks to see if it is a valid printer name. Some operating
systems don't care about upper- and lowercase names. Windows destinations generally
don't care, and UNIX systems are almost always case-sensitive.
If the destination printer name has any embedded spaces in it, such as "LaserJet
One", then the printer name on the LPR command line must be surrounded by either
apostrophe or quotation marks. If you use quotation marks beginning and ending the
whole LPR command line, then use the apostrophe around the printer name, as in:
LPR.JPAK.NSD "1234 PC1234 'laserjet one' "
Or, the other way around:
LPR.JPAK.NSD '1234 PC1234 "laserjet one" '
Destination System Requirements
The destination system must have the corresponding LPD software enabled to be able
to receive from the LPR software. Below is a table of LPD requirements for the three
main destination operating systems. Note that all of the required software is included
with each of these operating systems, however it may not be installed and/or enabled.
The Windows operating systems do not enable LPD by default. Most of the UNIX systems
enable LPD by default. The Linux systems may or may not. You can attempt to send
to your desired destination using the LPR program from the command line and generally
determine the state of LPD on the destination by reading the resulting error message.
In addition, depending on how security is set on the destination system, you may
have to set permissions on the destination to allow the HP3000 to print to it. Consult
the appropriate OS documentation to determine the security requirements.
HP3000 Downloads Available
from Nobix
This software is available at no charge to JobPak customers that have a current
support agreement.
|
Title
|
Link
|
Save as
|
Format
|
|
LPR program (required)
|
LPR.LABELS
|
LPR.JPAK.NSD
|
Reflection Labels Transfer
|
|
JobPak command file to send the spoolfile most recently examined by JobRescue or
ElectroPage
|
SENDLPR.LABELS
|
SENDLPR.XEQ.NSD
|
Reflection Labels Transfer
|
|
JobPak command file to send the reports from the job most recently examined by JobRescue
|
SENDRPTS.LABELS
|
SENDRPTS.XEQ.NSD
|
Reflection Labels Transfer
|
Command File Notes
The command files supplied via the download links above will require some customization.
At a very minimum, you will have to edit the lines that specify the remote system's
hostname or IP address, and the destination printer name to use.
If you are planning on sending different spoolfiles to different printers, then
you may wish to create your own command files using ours as examples. For example,
the SENDLPR command file already tests for different report names (we only supplied
it with example names, as we don't know the actual names of your reports, so you
will have to customize it) so that you can send them to different systems and/or
printers. However, the SENDLPR command file may not do all that you wish it to.
If you want something customized and lack the resources to accomplish it, then we
would be happy to do that for you.
These command files use the standard JobPak format, requiring the initial three line
PARM definition line (with continuation charcters) as is supplied in PARMLINE.JPAK.NSD. Note
that multiple command files may be executing at the same time within the JobPak job. This means
that any command interpreter variable names must be unique. In the examples below, note the use
of the !DFID command line parameter as a suffix on variable names, which then makes the variables
unique. You don't need to understand everything about these command files in order to use them, and we
are only a phone call or email away.
Installing
the LPR Program and Command Files
The download files are supplied in Reflection Labels transfer format. This means
that after you download the program and command files from the Nobix web site onto
your PC, you can use your Reflection terminal emulator software to upload
these files directly to your HP3000 and have the file attributes automatically set
by Reflection.
To install the LPR program, click on the link above named LPR.LABELS and
save the file to your PC. Then, using Reflection establish a session on your HP3000
as MGR.NSD. Select the Reflection File Menu, then Transfer. In the Transfer dialog,
the local filename should be the set to the name of the file that you downloaded
from the Nobix web site. The host filename should be set to LPR.JPAK.NSD.
The Protocol should be Reflection, and the Transfer Type should be LABELS.
Then click the button to transfer the file to the HP3000.
For the SENDLPR command file, use the same procedure as above, except set the local
filename to the downloaded SENDLPR.LABELS file on your PC, and set the host filename
to SENDLPR.XEQ.NSD
For the SENDRPTS command file, use the same procedure as above, except set the local
filename to the downloaded SENDRPTS.LABELS file on your PC, and set the host filename
to SENDRPTS.XEQ.NSD
Configuration
Once the LPR.JPAK.NSD program file is installed along with the command files SENDLPR.XEQ.NSD
and SENDRPTS.XEQ.NSD, you can configure them to be executed by JobPak as well as
perform any customization that you may require.
SENDLPR is designed to be used by ElectroPage customers who wish to send
a non-$STDLIST report to a remote system and printer. JobRescue customers can also
use SENDLPR to send a specific $STDLIST to a remote system for printing. SENDLPR
can be configured in CONFIGIX as a Job Specific command file or as a Global command
file. Once installed, SENDLPR must be customized for each report or $STDLIST that
is to be remotely printed. In SENDLPR there are a series of IF and ELSEIF commands
that test the report name and execute the appropriate LPR command. To customize,
you will have to edit the correct report names and set the correct remote system
and printer names on the LPR command lines.
|
SENDLPR command file snippet
|
if "!FileDes" = "THISRPT" then
LPR.JPAK.NSD "!Dfid remote_hostname 'printer)on_remote'"
elseif "!FileDes" = "THATRPT" then
LPR.JPAK.NSD "!Dfid remote_hostname 'printer_on_remote'"
elseif "!FileDes" = "MYRPT" then
LPR.JPAK.NSD "!Dfid remote_hostname 'printer_on_remote'"
elseif "!FileDes" = "YOURRPT" then
LPR.JPAK.NSD "!Dfid remote_hostname 'printer_on_remote'"
else
# two choices here if the report is not listed in the above
# if commands:
# 1. send to a default system and printer
# 2. don't do anything
endif
|
SENDRPTS is designed to be used by JobRescue customers who have not licensed
ElectroPage. It is generally configured as a Job Specific command file. SENDPRTS
sends all the reports from a job to a remote system and printer. SENDRPTS
may require a lot of customization depending on what you would like to accomplish
with it. If you have ElectroPage then it would be recommended to use SENDLPR instead
of SENDRPTS, as SENDLPR is easier to tailor to report name and remote printer requirements.
And again, if you want to do something and don't know how, we'll be happy to do
it for you.
|
SENDRPTS command file snippet
|
SETVAR REMOTE_SYSTEM!DFID "remote_hostname_or_ip_address"
SETVAR REMOTE_PRINTER!DFID "printer_name_goes_here"
BUILD Z!Dfid;MSG;TEMP
FILE Z!Dfid,OLDTEMP
SPOOLF O@;SELEQ=[JOBNUM = "!JobPrefix!JobNo" AND &
FILEDES <> "$STDLIST"];SHOW >*Z!Dfid
ECHO EOF >> *Z!Dfid
setvar LINE!DFID "X"
while str(LINE!DFID,1,3) <> "EOF" do
continue
input LINE!DFID < *Z!Dfid > $NULL
if pos("#",ups(LINE!DFID)) = 1 then
setvar THIS!DFID str(LINE!DFID,3,6)
continue
LPR.JPAK.NSD "![THIS!Dfid] &
![REMOTE_SYSTEM!DFID] '![REMOTE_PRINTER!DFID]'"
deletevar THIS!DFID
endif
endwhile
|
To configure either command file:
- Sign on as MGR.NSD
- Run the CONFIGIX.JPAK program
- To configure a command file as Global (executed for every spoolfile processed),
highlight Configure Gloal Values and press enter.
- To configure a command file to be executed by only a particular job, highlight
Configure Job Specific Values and press enter. Then add or select the pattern
matching the desired job and press enter.
- If you are using ElectroPage and you wish to configure a command file to be executed
only for a particular report, highlight Configure Report Specific Values
and press enter. Then add or select the pattern matching the desired report and
press enter.
- Scroll down to MPE :XEQ Scripts and press enter.
- Use the Tab key (do not use the arrow keys on this screen) to go to an empty field.
- Enter the name of the command filename, e.g. SENDLPR.XEQ or SENDRPTS.XEQ.
- Tab to the OKAY and press Enter.
- Use the F8 key to go to previous screens.
- Upon exit, press enter twice to save the changes. JobPak will load the new changes
as soon as you exit the CONFIGIX program.
Using LPR Outside of JobPak
In addition to running LPR.JPAK.NSD from a JobPak command file, you may run LPR
from within your own jobs or sessions from whatever account you are signed on as.
Simply use the syntax shown at the beginning of this page. The quotes surrounding
all of the command line arguments are required. Note that the LPR program must reside
in the JPAK.NSD group.
|