HP-UX SNAplus2 RJE User's Guide

SNAplus2 RJE Components and Operation
Processing Output Data
Chapter 3 55
#
copies=expr $6 + 1
cat | lp -f$3 -n $copies
If this script, named myprog, is called with the PDIR parameters in the
example PDIR file shown earlier in this chapter, the host output would
be piped to:
Figure 3-3
myprog would then calculate the number of copies as 1 and pipe the
output to:
lp -fSTD -n1
A more complicated example of an output program is listed in Appendix
A of this manual.
General Guidelines for Output Programs
The program runs with the user and group ID of the primary user and
group of the workstation as specified in the workstation configuration
unless the permissions on the file allow it to run as owner (for example,
the executable has the setuid bit on).
The environment in which the program runs is inherited from the user
who started the workstation. However, it is preferable to set any
required environment variables explicitly from within the program,
rather than relying on the inherited environment. Similarly, if the
program needs to access files, it should specify the full path of the file to
open (rather than relying on the environment).
If the program uses STDOUT and STDERR, reroute the output (for
example, to a file) instead of sending it to the screen (which is the default
for HP-UX STDOUT and STDERR).
Routing Received Files with a usr Card
A usr card is an instruction to SNAplus2 RJE that can be included in a
job file. It is used to do the following:
route a single job’s files returning from the SNA host computer.
notify the user when the file has been returned.
myjob 11/14/91 18.28.46 STD STD6 QN 0 30 NEWJOB1 None None None None 1