The Work Job 2 command is a more powerful version of the system
WRKJOB command. Both commands display the 'Work with Job' menu if
only a single job exists. Both commands display a subfile if
multiple jobs exist. WRKJOB2 supports options for WRKJOB and DSPJOB
OUTPUT(*PRINT) and all of the detail options available on the WRKJOB
menu. When the option completes, the subfile is re-displayed.
WRKJOB2 also allows options for all jobs, all users, job status, and
job type.
To request a job other than the for the current user, the user must
have *JOBCTL authority.
A typical command would be:
WRKJOB2 JOB(xxx)
If only a single job exists for the qualified job name, the 'Work
with Job' menu appears.
If multiple jobs exist for the same qualified job name, a subfile
display appears and options exist to use WRKJOB or DSPJOB
OUTPUT(*PRINT) or directly access the detail options of the WRKJOB
display. When the option is complete, the subfile is displayed
again.
Command selection options exist for:
** Job name (or generic name) or *CURRENT or all jobs.
** User name (or generic name) or *CURRENT or all users.
** Job type (such as *INTER) may be specified to display only the
interactive jobs.
** Job status (such as *JOBQ) may be specified to display only
those jobs on the job queue.
An option exists to determine what should occur if no jobs exist to
meet the criteria specified. The default is to send an escape
message. You may specify that the user should see the subfile
display with an appropriate message stating that no jobs exist.
Differences with DSPJOB2
------------------------
WRKJOB2 differs from the DSPJOB2 command in that options exist to
cause changes such as changing spooled files or ending jobs that have
locks.
WRKJOB2 escape messages you can monitor for
--------------------------------------------
TAA9895 No jobs exist (Optional based on ESCAPE parm)
Escape messages from based on functions will be re-sent.
Command parameters *CMD
------------------
JOB The qualified job name of the job to be worked with.
The default is for all jobs for the current user.
This differs from the WRKJOB default of a display of
the current job.
The default for the JOB name portion is *ALL. A
specific job name, a generic name, or *CURRENT may
be specified.
The default for the USER portion is *CURRENT. A
specific user name, a generic name, or *ALL may be
specified.
The default for the job number portion is *ALL. A
specific number may be entered.
STATUS The status of the job to be displayed. The default
is *ALL for jobs in any status.
*ACTIVE, *JOBQ, or *OUTQ may be specified to select
only those jobs that have the same status.
TYPE The type of the job to be displayed. The default is
*ALL for any type of job to be displayed.
*AUTO, *BATCH, *INTER, *SBS, *SPLRDR, *SPLWTR, *SYS,
or *SCPF may be specified to select only those jobs
that have the same type.
ESCAPE Whether to send an escape message if no jobs exist
for the qualified job name, status, and type. The
default is *YES which means the TAA9895 escape
message would be sent.
*NO may be specified to cause the subfile to be
displayed with an appropriate message.
ACTSTS The status of the initial thread of the job to be
displayed. Applies to active and job queue jobs
only. The default is *ALL for any active status to
be displayed. Use the command prompter for a full
list of the values. Up to 10 values may be
specified.
CMPSTS For jobs that have ended, the completion status of
the job. Indicates whether the job completed
normally or abnormally. The default is *ALL for any
completion satus to be displayed. *NORMAL or
*ABNORMAL may be specified to select only those jobs
that have the same completion status.
JOBQ The qualified name of the job queue whose jobs are
to be displayed. A single job queue or *ALL may be
entered. The library value defaults to *LIBL.
SBS The name of the subsystem whose jobs are to be
displayed. Up to 10 subsystems or *ALL may be
entered. The default is *ALL for all subsystems.
JOBDATRNG A 4 part parameter to describe the date and time
range to select. This range is applied to the date
and time that the job entered the system.
Part 1 is the from-date of the range. The default
is *BEGIN meaning any jobs that meet the other
selection criteria are shown. If a specific date is
entered, it must in the date format of the current
job.
Part 2 is the from-time of the range. The default
is *AVAIL meaning whatever is available for the from
date. If a specific time is entered, it must be in
HHMMSS format.
Part 3 is the to-date of the range. The default is
*END meaning the date of the last date a job entered
the system. If a specific date is entered, it must
in the date format of the current job.
Part 4 is the to-time of the range. The default is
to *AVAIL meaning whatever is available for the
to-date. If a specific time is entered, it must be
in HHMMSS format.
DFTVIEW The initial view of the jobs to be displayed. Valid
values are 1 and 2.
View 1 shows job name, job user, job number, job
type, job status, date job entered system, and
date/time job completed.
View 2 shows job name, job user, job number, job
queue, subsystem, queue minutes, run minutes, and
active satus.
The default is 1.
PRTSQL Specifies whether to print a spooled file containing
the SQL statement generated and used to retrieve the
jobs.
Valid values are *YES and *NO.
*YES specifies that a spooled file containing the
SQL statement is to be printed. The spooled file
name will appear in the current job and is named
PRTSQL.
*NO specifies that no SQL spooled file is to be
printed.
The default is *NO.
SBMUSER Specifies the user profile that submitted the job.
A specific user profile name may be entered.
*ALL specifies jobs submitted by all user profiles.
*CURRENT specifies all jobs submitted by the current
user profile.
The default is *ALL.
Restrictions
------------
There are differences between WRKJOB and WRKJOB2 when the subfile is
displayed. WRKJOB2 does not show all of the detail job types
supported by WRKJOB nor some of the details of the Status field.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHKJOBCTL Check job control
CVTDAT Convert date program
FILEFDBCK File feedback
SNDESCMSG Send escape message
UNADOPT Unadopt
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
WRKJOB2 *CMD TAAJOCR QATTCMD
TAAJOCRC *PGM CLP TAAJOCRC QATTCL
TAAJOCRC2 *PGM CLP TAAJOCRC2 QATTCL
TAAJOCRR *PGM RPG TAAJOCRR QATTRPG
TAAJOCRD *FILE DSPF TAAJOCRD QATTDDS
|