You need to consider various aspects of jobs and documents to be able to manage them properly in Advanced Printing Software. Generally, three types of attributes reflect the different aspects of job and document management:
Attributes that affect the job or document object itself without regard to the data that is to appear on the printed output. These attributes include setting the input and the output trays to be used on the print device.
Attributes that determine how the spooler and supervisor process print data. These attributes might include translation filters.
Attributes that determine the look and content of the actual printed output. These attributes include those that influence how pages are laid out on each sheet of paper and determine whether separator pages are output between documents.
7.1 Performing Job and Document Operations
Job and document operations that users perform on a regular basis can include the following:
It is important to understand the difference between a job and a document. A job can contain many documents and can contain a number of different processing instructions for each document.
For a detailed description of the commands discussed in this chapter,
refer to the reference page for the command.
7.1.1 Printing a Job
A print operation creates the job object and the document objects from your print request to print one or more files. The spooler creates a job object for each print request and a document object for each file a user specifies as part of a single print request. A job object, therefore, contains one or more document objects.
For each job, the spooler assigns a unique job identifier (job-identifier
) that is used to identify the job when job operations
are performed, such as pausing the job.
Print requests are made using the
pdpr
command.
The
pdpr
command has the following syntax:
pdpr
[-f file_name
]
[-n copies
]
[-N notification_method
]
[-p logical_printer_name
]
[-t job_namefiles
]
The following examples show how to use the
pdpr
command
to submit print requests:
To print the
mail-file.txt
file on the
default logical printer (PDPRINTER), use the following command:
# pdpr mail-file.txt
To print the
mail-file.txt
file on printer
pr_doc1, use the following command:
# pdpr -p pr_doc1 mail-file.txt
To print the
front-page.ps
file onesided
and the files
ch1.ps
and
ch2.ps
twosided,
use the following command:
# pdpr -x sides=1 -f front-page.ps -x sides=2 ch1.ps ch2.ps
The
pdpr
command can also read document data from
standard input, thereby allowing it to be used in a pipe expression.
To print a listing of the current directory, use the following command:
# ls -l | pdpr
7.1.2 Printing a Job After a Specified Time
You can submit a print request and specify that the job be printed after a specified date and time. You can also specify the print date and time with a set or modify operation.
You might want to specify a print date and time for a large job so that it prints during a low print volume period.
To specify a date and time, use the following syntax:
dd:mm:yyyy:hh:mm:ss
When you set a print date and time for a job, the spooler:
Sets the
current-job-state
attribute to
held.
Adds the
job-print-after-specified
value
to the attribute
job-state-reasons
.
When the specified print date and time has passed, the spooler schedules
the job and changes
current-job-state
to pending.
The following examples show how to specify a print time for a job:
To specify the time to print a job when you submit the job, use the following command:
#pdpr -x job-print-after=31:12:2002:12:59:59 book1.ps
If you submit a job and then decide that you want to modify the job so that it prints after 7:00 a.m. on January 25, 2002, use the following command:
#pdmod -x 'job-print-after=25:01:2002:07:00' red_spl:1258
7.1.3 Listing Job and Document Attributes
You can use the
pdls
command to display attributes
and values of print system objects, such as printers, queues, jobs, documents,
and server processes.
You can use this command to list the following attributes:
An object you specify
All objects of a class you specify (except the server class)
A subset of all objects that you have filtered
The
pdls
command displays information only about
an object for which you have sufficient access-control privilege.
For jobs
belonging to other users, the server returns only those attributes specified
in the server
job-attributes-visible-to-all
attribute.
The command writes its list of attributes to standard output.
The
pdls
command has the following syntax:
pdls
[-c class_name
]
[-f filter_expression
]
[-F
]
[-g
]
[-r requested_attributes
]
[-s style_name
]
[-x extended_attribute_string
...]
[-X attribute_filename
...]
[[
object_instance
]...]
The following examples show how to use the
pdls
command
to display job attributes and values:
To lists the printer attributes of printers
lab200
and
mimi
:
# pdls -c printer lab200 mimi
To list all queues on the default spooler:
# pdls -c queue
To list the job and document attributes for job
status
on spooler
blu_spl
:
# pdls -c job -x "scope=1" blu_spl:status
You can use the
pdq
command to query a logical printer
for a list of jobs that are currently in the printer's queue.
The list displays
the jobs in the scheduled print order.
The
pdq
command
writes the list of jobs to standard output.
If you do not use the
-p
option to specify a printer,
pdq
lists jobs
in the queue of the printer specified by the
PDPRINTER
environment variable.
Thepdq
command has the following syntax:
pdq
[-f filter_expression
]
[-F
]
[-g
]
[-p printer_name
]
[-r requested_attributes
]
[-s style_name
]
[-x extended_attribute_string
...]
[-X attribute_filename
...]
[server_name:
]
[job_id
[.doc_int
]]
The following examples show how to use the
pdq
command
to list job queues:
Display the jobs you submitted to the queue associated with the default printer:
# pdq
Display all your jobs in the queue associated with the logical printer, myprinter:
# pdq -p myprinter
Display the jobs you have submitted to your default printer, and show their state and when they were submitted:
# pdq -r "job-ident job-name submission-time current-job-state"
Display all information about job
123
and
its documents:
pdq -r all -s line -x scope=1 123
Display all pending jobs on spooler,
sonny_sp1
belonging to user,
copperfield
pdq -f "(job-owner==copperfield) && (cur-job-state==pending)" sonny_spl:
7.1.5 Modifying Job and Document Attributes
You can use the
pdset
and the
pdmod
commands to modify job and document attributes.
The
pdset
command sets, adds, or removes values of
writable attributes of printers, queues, servers, jobs, documents, and initial-value
objects.
Changes you make to the attribute values of an object are persistent;
they remain in place even after the system is restarted.
The specified attribute
values will be set for every object you include as a command operand.
Some object attributes make reference to other objects in your configuration. To set any of the following print attributes, the new value must refer to an object that already exists:
associated-queue
printer-initial-value-job
printer-initial-value-document
Administrators can set attribute values of any object in the system. An operator can set attributes of any job and values of the xxx-ready attributes for physical printers. An end user can set only attribute values of owned jobs.
The
pdset
command has the following syntax:
pdset
[-c class_name
]
[-g
]
[-m message_text
]
[-r requested_attributes
]
[-s style_name
]
[-x extended_attribute_string
...]
[-X attribute_filename
...]
object_instance
...
The following examples show how to use the
pdset
command:
To connect physical printer
ginney
to queue
les
.
# pdset -c printer -x associated-queue=les ginney
To add iso-a4-white media to the media-supported attribute
for the printer named samantha.
The operand is assumed to be a printer name
because the default class for the
pdset
command is printer.
# pdset -x "media-supported+=iso-a4-white" samantha
To release job
21
, which was placed in
the held state when it was submitted for printing:
# pdset -c job -x "job-hold=no" spl:21
The
pdmod
command modifies job and document attributes
of a job that you have submitted for printing but that has not yet started
to print.
Changes you make to the job are persistent; that is, they remain
in place after the system is restarted.
The job you are modifying does not lose its position in the queue; however, a resource check of the entire job or document attributes takes place again if you resubmit the print job.
The
pdmod
command has the following syntax:
pdmod
[-g
]
[-m message_text
]
[-n copies
]
[-N notification_method
]
[-r requested_attributes
]
[-s style_name
]
[-t job_name
]
[-x
extended_attribute_string
...]
[-X
attribute_filename
...]
[server_name:
]
job_id
[.doc_int
]
The following examples show how to use the
pdmod
command:
To change the copy count to 4 for the job with an ID of
10
on
spooler1
:
# pdmod -n 4 spooler1:10
To change the job retention period to one hour for job
32704
on the default spooler:
# pdmod -x "job-retention-period=1:00:00" 32704
To change the default media for the third document of job 12987 on the default spooler:
# pdmod -x "default-medium=a" 12987.3
You can use the
pdrm
command to remove or cancel
a job that was submitted for printing.
If the job is currently printing, the
spooler forwards the operation to the supervisor and printing is stopped as
soon as possible.
The print job is retained, if you specify the
-r
retention_period
option in the command line, or if the
job-retention-period
attribute has a nonzero value.
Retained jobs
can be resubmitted for printing later.
The
pdrm
command ihas the following syntax:
pdrm
[-m message_text
]
[-r retention_period
]
[-x extended_attribute_string
...]
[-X attribute_filename
...]
[ server_name:
]
job_id
...
The following examples show how to use the
pdrm
command:
To remove job
2127
from the default spooler:
# pdrm 2127
To remove and retain job
2002
for one hour
before deleting it from the spooler named
ginger
.
# pdrm -r 1:00:00 ginger:2002
You can resubmit a submitted job for printing to a different printer on the same spooler.
A job must be in any of the following states to be resubmitted:
Pending
Held
Paused
Retained
Terminating (provided the state does not contain
documents-needed
for the
job-state-reasons
attribute)
You cannot resubmit a job whose state is
completed
,
processing
, or
printing
.
The
pdresubmit
command has the following syntax:
pdresubmit
logical_printer_namejob_id
[job_id2
]...
pdresubmit
-c queuelogical_printer_name queue_name
The operand is either a job identifier or a queue name. You can resubmit individual jobs or you can resubmit all jobs in a queue to another logical printer.
The following examples show how to use the
pdresubmit
command to resubmit jobs:
To resubmit job
2000
to printer
lpx0001
:
# pdresubmit -c job lpx0001 2000
To resubmit all jobs in a specified queue, you must first
disable the queue and then perform the resubmit operation.
To resubmit all
jobs from the queue
qpx0001
to the logical printer lpx0001:
# pddisable -c queue qpx0001 # pdresubmit -c queue lpx0001 qpx0001
Note that when you perform this operation, the spooler takes the following action:
Removes all jobs that are pending, paused, or held from the specified queue and resubmits them to the specified target logical printer.
Returns a warning for any jobs that it does not successfully resubmit. These jobs must be resubmitted manually.
In this example, both printers must be associated with the same spooler.
Note that the
pdresubmit
command is asynchronous.
The command returns a prompt before the server completes the operation.
7.1.8 Promoting a Job
You can move a job to the front of the queue. The job will be printed before jobs that have not been promoted, regardless of submission time. While you can promote only one job at a time, promoting several jobs in the same queue causes the most recently promoted job to be printed first.
The currently printing job continues normally at each of the physical printers associated with the queue containing the job to be promoted. The spooler assigns the most recently promoted job to the first physical printer that completes its current job and that can handle the promoted job.
You can promote jobs that have a
current-job-state
of
pending
or
held
.
The queue state
must be either
ready
or
paused
.
Administrators and operators can use the
pdpromote
command to promote a job.
End users cannot promote jobs.
The
pdpromote
command has the following syntax:
pdpromote
[-m message_text
]
[server_name:
]
job_id
The following example shows how to use the
pdpromote
command:
To promote job
2249
on spooler
sx0001_spl
:
# pdpromote sx0001_spl:2249
You can pause a job before it is submitted to a physical printer for printing. Other jobs in the queue are submitted around the paused job.
Only pending or held jobs can be paused. That is, a job that has started to print cannot be paused. When you pause a job:
A specific document within the job cannot be paused. The whole job is paused.
The job cannot be rescheduled until it is resumed.
The operation fails if the job has already been submitted to the supervisor for printing.
The
pdpause
command has the following syntax:
pdpause
-c job
[-m message_text
]
[server_name:
]
job_id
The following example shows how to use the
pdpause
command:
To pause job
11224
on
spooler1
and include a message:
# pdpause -c job -m "Job will be printed later"\ spooler1:11224
You can resume paused jobs with the
pdresume
command.
When you resume a paused job, the job becomes available for scheduling and
printing.
The
pdresume
command has the following syntax:
pdresume
-c class_name
[-m message_text
]
[server_name:
]
job_id
The following example shows how to use the
pdresume
command:
To resume job
11224
:
# pdresume -c job spooler1:11224
You can hold a job so that the spooler does not schedule it for printing.
You place a job on hold by setting the
job-hold
attribute
to yes.
When you hold a job, the spooler:
Sets the
current-job-state
attribute to
held.
Adds the
job-hold-set
value to the
job-state-reasons
attribute .
Holding a job is similar to pausing a job, except the job remains on hold indefinitely unless one of the following events occurs:
You set the
job-hold
attribute to no.
The
spooler can then schedule the job and set its
current-job-state
attribute to pending.
The job discard time that you previously set passes. The spooler then deletes the held job.
You cleared the associated queue or spooler. The spooler deletes all jobs in the queue or spooler, including jobs in the held state.
The following examples show how to place a job on hold:
The person who owns the job can use the
pdmod
command to place job
2002
on spooler
sx0001_spl
on hold:
# pdmod -x 'job-hold=yes' sx0001_spl:2002
An administrator or operator can use the
pdset
command to hold the same job:
# pdset -x 'job-hold=yes' sx0001_spl:2002
To remove the hold on a job, use the
pdset
or
pdmod
command as shown in the following examples:
# pdset -x 'job-hold=no' sx0001_spl:2002 # pdmod -x 'job-hold=no' sx0001_spl:2002
You can cause the spooler to retain a job for a specified period after the job completes printing. A retained job is available for possible resubmitting or examination.
When you retain a job, the spooler:
Retains the job object, its attributes, and its documents, even after the job has completed.
Sets the
current-job-state
attribute to
retained.
The job remains in the retained state until one of the following events takes place:
The retention period elapses. The spooler then deletes the retained job.
You clean the associated queue or spooler. The spooler deletes all jobs in the queue or spooler, including jobs in the retained state.
The
pdmod,
pdset,
or
pdrm
command can cause a job to be retained when it completes.
End
users can set the retention period on their jobs with the
pdmod
and
pdrm
commands.
Administrators and operators can use
the
pdset
command to set the retention period of any job.
The following examples use these commands to retain a job:
To retain job
3021
on spooler
sx0001_spl
for 24 hours, issue one of the following commands:
# pdrm -r '24:00' sx0001_spl:3021 # pdmod -x "job-discard-time=24:00" sx0001_spl:3021 # pdset -c job -x "job-discard-time=24:00" sx0001_spl:3021
Note that the
pdrm
command causes the job to be canceled
and removed from the queue while the job is retained for possible resubmission.
You can specify that the spooler delete a job if the job is not printed
by a certain time.
The
job-discard-time
attribute specifies
the time.
When the job discard time arrives, the spooler deletes the job whether or not it has printed and regardless of the job state.
To specify a job discard time, end users can use the
pdmod
command, and administrators and operators can use the
pdset
command.
The following examples show how to set a job discard time:
To discard job
3021
at 5:00 p.m.
on January
2, 2002 enter one of the following commands:
# pdmod -x "job-retention-period=02:01:2002:17:00:00" 3021 # pdset -c job \ -x "job-retention-period=02:01:2002:17:00:00" 3021
You can use the -m option with the following commands to include a message about a job or a document when you are altering or changing the state:
pdclean
pdcreate
pddelete
pddisable
pdenable
pdmod
pdpause
pdresume
pdrm
pdshutdown
If you are an end user, you can include a message only for commands
for which you have access; for example, the
pdmod
command.
However, you can view a message included by an administrator by issuing the
pdls
command and specifying the job or documents.
The following examples show how to include a message:
To hange the copy count and include a message:
# pdmod -m "changing copy count" -n 4 spooler1:10
To remove a job and include a message:
# pdrm -m "removing job file corrupt" 2127
7.1.15 Including Event Notification
You can receive notification when your job has completed by using the
-N
option of the
pdpr
command and specifying the
notification method.
The notification method is either e-mail, which sends
you an e-mail message, or message, which sends a message to the console window.
The following example shows how to specify notification:
Send e-mail notification when the
semantics.txt
file completes printing:
# pdpr -N email semantics.txt