WRKJOB (Work with Job)

WRKJOB Command syntax diagram

 

Purpose

The Work with Job (WRKJOB) command allows the user to work with or change information concerning a job.

A user can work with or change the following:

The information for the following options can be shown only when the job is active: job run attributes, call stack information, job lock information, library list information, job log information, open file information, file override information, commitment control status, communication status, activation group information, mutex information, thread information and media library attribute information. Job status attributes, job definition attributes, and spooled file information can be shown whether the user's job is on the job queue, on an output queue, or active in the system. However, the job is not considered to be in the system until all of its input has been completely read in; only then is an entry placed on the job queue.

 

Restrictions

  1. The command must be issued from within the job being displayed, or the issuer of the command must be running under a user profile which is the same as the job user identity of the job being displayed, or the issuer of the command must be running under a user profile which has job control (*JOBCTL) special authority.

    The job user identity is the name of the user profile by which a job is known to other jobs. It is described in more detail in the Work Management Link to PDF book.

  2. Activation group information for a job cannot be shown if the job is being held when this command is run.
  3. This command fails in a job that allows multiple threads if OPTION(*FILOVR) or OPTION(*ALL) is specified.

 

Optional Parameters

JOB
Specifies the name of the job whose information the user is working with. If no job qualifier is given, all of the jobs currently in the system are searched for the simple job name. If duplicates of the specified name are found, a list of messages containing the qualified job names of all duplicates is shown.

A job identifier is a special value or a qualified name with up to three elements. For example:

*
job-name
user-name/job-name
job-number/user-name/job-name

More information on this parameter is in commonly used parameters.

*: The job whose information is shown is the job where this work with command is issued.

job-name: Specify the name of the job whose information is to be displayed.

user-name: Specify the name of the user of the job whose information is to be displayed.

job-number: Specify the number of the job whose information is to be displayed.

OUTPUT
Specifies whether the output from the command is shown at the requesting workstation or printed with the job's spooled output. More information on this parameter is in commonly used parameters.

*: Output requested by an interactive job is shown on the display. Output requested by a batch job is printed with the job's spooled output.

*PRINT: The output is printed with the job's spooled output.

OPTION
Specifies the job information with which the user is working. Only one value may be selected.

*SELECT: A list of options is shown that allows a user to select the information with which to work.

*STSA: The status attributes associated with the job are shown.

*DFNA: The definition attributes associated with the job are shown.

*RUNA: The run attributes associated with the job are shown.

*SPLF: The spooled files associated with the job are shown.

*JOBLOG: The job log associated with the job is shown. The job log is printed or shown depending on what is specified for the OUTPUT parameter. This value is not shown when either OPTION(*SELECT) or OPTION(*ALL) is specified.

*PGMSTK: The call stack associated with the initial thread of the job is shown.

*JOBLCK: The job locks associated with the job are shown.

*LIBL: The library list associated with the job is shown.

*OPNF: The open files associated with the job are shown.

*FILOVR: The file overrides associated with the job are shown.

*CMTCTL: The commit control status of the job is shown.

*CMNSTS: The communications status of the job is shown.

*ACTGRP: The activation groups associated with the job are shown.

*MUTEX: The mutex information associated with the initial thread of the job is shown.

*THREAD: Information about the job's threads is shown.

*MLBA: Information about the job's media library attributes is shown.

*ALL: All job information associated with the job is shown.

DUPJOBOPT
Specifies the action taken when duplicate jobs are found by this command.

*SELECT: The selection display is shown when duplicate jobs are found during an interactive session. Otherwise, a message is issued.

*MSG: A message is issued when duplicate jobs are found.

Examples for WRKJOB

Example 1: Printing the Job's Information

WRKJOB  JOB(SMITH/PAYROLL)  OUTPUT(*PRINT)

This command allows the user to print information for the job named PAYROLL submitted by the user named SMITH to the job's output spooling queue for printing.

Example 2: Working with the Current Job's Spooled Output

WRKJOB  OPTION(*SPLF)

This command allows the user to work with the spooled output for the current job.

Example 3: Working with All of the Current Job's Information

WRKJOB  OPTION(*ALL)

This command allows the user to work with all of the information for the current job.

Error messages for WRKJOB

*ESCAPE Messages

CPF0941
Job &3/&2/&1 no longer in system.
CPF1069
End of duplicate names.
CPF1070
Job &3/&2/&1 not found.
CPF1071
No authority to job &3/&2/&1.
CPF2443
Job log not displayed or listed because job has ended.
CPF3330
Necessary resource not available.
CPF3336
Job &5/&4/&3 no longer in the system.
CPF9845
Error occurred while opening file &1.
CPF9846
Error while processing file &1 in library &2.
CPF9847
Error occurred while closing file &1 in library &2.
CPF9850
Override of printer file &1 not allowed.
CPF9851
Overflow value for file &1 in &2 too small.
CPF9871
Error occurred while processing.