Work with Job (WRKJOB)
|Where allowed to run: All environments (*ALL)
The Work with Job (WRKJOB) command allows you to work with or change the following information concerning a user job:
- Job status attributes
- Job definition attributes
- Job run attributes
- Spooled file information
- Job log information
- Call stack information
- Job lock information
- Library list information
- Open file information
- File override information
- Commitment control status
- Communications status
- Activation group information
- Mutex information
- Thread information
- Media library attribute information
- Environment variables
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, communications status, activation group information, mutex information, and thread information.
The following options can be found regardless of whether the user's job is on the job queue, on an output queue, or active in the system: job status attributes, job definition attributes, and spooled file information. Note, however, that 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.
- 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 worked with, 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. More information about the job user identity is in the Work management topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
- Activation group information for a job cannot be shown if the job is being held when this command is run.
- This command fails in a job that allows multiple threads if OPTION(*FILOVR) or OPTION(*ALL) is specified.
- You must have service (*SERVICE) special authority to display environment variables for a job running under a different user profile.
|JOB||Job name||Single values: *
Other values: Qualified job name
|Optional, Positional 1|
|Qualifier 1: Job name||Name|
|Qualifier 2: User||Name|
|Qualifier 3: Number||000000-999999|
|OUTPUT||Output||Optional, Positional 2|
|OPTION||Option||*SELECT, *STSA, *DFNA, *RUNA, *SPLF, *JOBLOG, *PGMSTK, *JOBLCK, *LIBL, *OPNF, *FILOVR, *CMTCTL, *CMNSTS, *ACTGRP, *MUTEX, *THREAD, *MLBA, *ENVVAR, *ALL||Optional|
|SLTTHD||Thread ID to include||Single values: *ALL, *SELECT
Other values (up to 20 repetitions): Character value, *INITIAL, *CURRENT
|DUPJOBOPT||Duplicate job option||*SELECT, *MSG||Optional|
Job name (JOB)
Specifies the name of the user job whose information is being worked with.
- The job whose information is displayed is the job from which this display command is run.
Qualifier 1: Job name
- Specify the name of the job to be displayed. 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 displayed.
Qualifier 2: User
- Specify the name that identifies the user profile under which the job is run.
Qualifier 3: Number
- Specify the job number assigned by the system.
Specifies whether the output from the command is displayed at the requesting work station or printed with the job's spooled output.
- The output is displayed for interactive jobs or printed with the job's spooled output for non-interactive jobs.
- The output is printed with the job's spooled output.
Specifies which information is being worked with.
- The menu is shown and all options and function keys are available.
- The identifying characteristics and the status of the job are shown.
- The definition attributes in the job description associated with the job are shown.
- The run attributes for the job are shown.
- The spooled files owned by the job are shown. Only those spooled output files which are on output queues in the library name space of the thread issuing this command will be shown.
- The commands processed by the job and the messages returned from running those commands are shown.
- All information for all programs in the call stack is shown.
- All external object locks held by the job, including held locks and lock that are being waited for, are shown.
- The library list for the thread is shown if the job specified for the Job name (JOB) parameter is the job from which the command is run. For other jobs, the library list of the initial thread is shown.
- Files that are open for the job and the status of system and user files are shown.
- File overrides at any active call level for the job are shown.
- The commitment control status of the job is shown.
- The communications status of the job is shown.
- The activation groups associated with the job are shown.
- The mutex information associated with the initial thread of the job is shown.
- Information about the job's threads is displayed.
- Information about the job's media library attributes is displayed.
- The job's environment variables are displayed.
- All options are shown.
Thread ID to include (SLTTHD)
Specifies a list of thread identifiers whose information is to be included.
- All threads within the specified job are included.
- A list of thread identifiers is shown from which the user can select up to twenty to be included. This value is only valid if the command is run in an interactive job.
Other values (up to 20 repetitions)
- The initial thread within the specified job is included.
- The thread running the command is included. This value is only valid if the specified job is the job running the command.
- Specify the identifiers of up to twenty threads whose information is to be included. This is the thread ID as shown by the Work with Job (WRKJOB) command.
Duplicate job option (DUPJOBOPT)
Specifies the action taken when duplicate jobs are found by this command.
- The selection display is shown when duplicate jobs are found during an interactive session. Otherwise, a message is issued.
- A message is issued when duplicate jobs are found.
Example 1: Printing the Job's Information
WRKJOB JOB(SMITH/PAYROLL) OUTPUT(*PRINT)
This command prints information for the job named PAYROLL submitted by the user named SMITH to the job's output spooling queue.
Example 2: Working with the Current Job's Spooled Output
This command allows you to work with the spooled output for the current job.
Example 3: Working with All of the Current Job's Information
This command allows you to work with all of the information for the current job.
- Job &3/&2/&1 no longer in system.
- End of duplicate names.
- Job &3/&2/&1 not found.
- No authority to job &3/&2/&1.
- Job log not displayed or listed because job has ended.
- Necessary resource not available.
- Job &5/&4/&3 no longer in the system.
- Error occurred while opening file &1.
- Error while processing file &1 in library &2.
- Error occurred while closing file &1 in library &2.
- Override of printer file &1 not allowed.
- Overflow value for file &1 in &2 too small.
- Error occurred while processing.