Remove Pending Job Log (QWTRMVJL) API


  Required Parameter Group:

1 Job selection information Input Char(*)
2 Job selection format name Input Char(8)
3 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: Yes.

The Remove Pending Job Log (QWTRMVJL) API changes a completed job whose job log has not yet been written. The job messages are removed. The job log can no longer be produced or displayed.

If the spooled file action for the job specifies that spooled files are to be detached or if the only remaining spooled files for the job are in independent auxiliary storage pools (ASPs), the job is removed from the system.


Authorities and Locks

Job Authority
The caller of the API must be running under a user profile that is the same as the user name specified in the job selection information. Otherwise, the caller of the API must be running under a user profile that has job control (*JOBCTL) special authority.

Required Parameter Group

Job selection information
INPUT; CHAR(*)

Information that is used for selecting completed jobs for which pending job logs will be removed. See Format of Job Selection Information for a description on the layout of this parameter.

Job selection format name
INPUT; CHAR(8)

The format of the job selection information. The possible format names are:

RJLS0100 See RJLS0100 Format for details on the job selection information.
Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Format of Job Selection Information

The organization of the job selection information parameter is shown below. A description of the fields in the parameter follows the table.


RJLS0100 Format

Offset Type Field
Dec Hex
0 0 BINARY(4) Length of job selection information
4 4 BINARY(4) Days since job completion
8 8 CHAR(10) Job name
18 12 CHAR(10) User name
28 1C CHAR(6) Job number
34 22 CHAR(10) Job log output


Field Descriptions

Days since job completion. The minimum number of days that the job log has been pending. This may be zero. This must be non-negative. Refer to Usage Notes before coding a zero for this field.

Job log output. One of the following special values:

*ALL All completed jobs that have a pending job log, regardless of the value specified for the Job log output (LOGOUTPUT) job attribute.
*PND Only completed jobs that have a pending job log and that specify *PND for the Job log output (LOGOUTPUT) job attribute.

Job name. A specific job name, a generic name, or one of the following special values:

*ALL All completed jobs with the specified user name and job number, regardless of job name.

Job number. A specific job number or one of the following special values:

*ALL All completed jobs with the specified job name and user name, regardless of the job number.

Length of job selection information. The length of the job selection information passed. Valid values are:

44 All job selection information is required.

User name. A specific user profile name, a generic name, or one of the following special values:

*ALL All completed jobs with the specified job name and job number, regardless of the user name.


Usage Notes

  1. This API can remove pending job logs for all completed jobs, even those jobs that specify *JOBEND or *JOBLOGSVR for the Job log output (LOGOUTPUT) job attribute. Do not code a zero for the days since job completion field unless you have verified that you really do not need a job log. There is a delay between the time a job completes and the time a job log server job can write the job log.

  2. This API may be automatically called by the system. Refer to the Change Cleanup (CHGCLNUP) command for more information. To avoid having the system automatically call this API, specify *NO for the Allow cleanup (ALWCLNUP) parameter or specify *KEEP for the Job logs and system output (SYSPRT) parameter of the Change Cleanup (CHGCLNUP) command.

    Operational Assistant cleanup uses *ALL for the Job log output field when calling this API. The system keeps pending job logs and spooled job logs for the same number of days. To specify the value that Operational Assistant uses for the days since job completion, use the Job logs and system output (SYSPRT) parameter of the Change Cleanup (CHGCLNUP) command. This can also be changed by using "GO CLEANUP" from a command line and selecting option 1 to change cleanup options.

  3. You can obtain a list of jobs and use the Remove Pending Job Log (QWTRMVJL) API to implement your own cleanup policy. Refer to the Open List of Jobs (QGYOLJOB) API, the List Job (QUSLJOB) API, and the Work Management API Attribute Descriptions (WMAttrDesc). Refer to the Add Job Schedule Entry (ADDJOBSCDE) command for information on how to schedule a batch job to be submitted at regular intervals.


Error Messages

Message ID Error Message Text
CPF1321 E Job &1 user &2 job number &3 not found.
CPF133C E Job &3/&2/&1 not completed.
CPF1344 E Not authorized to control job &3/&2/&1.
CPF24B4 E Severe error while addressing parameter list.
CPF3C21 E Format name &1 is not valid.
CPF3C3B E Value for parameter &2 for API &1 not valid.
CPF3CF1 E Error code parameter not valid.
CPF3CF2 E Error(s) occurred during running of &1 API.
CPF8100 E All CPF81xx messages could be returned. xx is from 01 to FF.
CPF9800 E All CPF98xx messages could be signaled. xx is from 01 to FF.



API introduced: V5R4

[ Back to top | Work Management APIs | APIs by category ]