jobquery command - Performing queries on jobs

Use the jobquery command to perform advanced queries on submitted jobs.

Syntax

jobquery ?

jobquery [-usr user_name -pwd password] {[-status status…] [-submitter submitter] [-name job_definition_name] [-alias job_alias] [-sdf submit_date_from] [-sdt submit_date_to] [-jsdf job_start_date_from] [-jsdt job_start_date_to ] [-jedf job_end_date_from] [-jedt job_end_date_to]} [-configFile configuration_file]

Description

This command performs advanced queries on submitted jobs based on the following attributes:
  • job status
  • name of the user who submitted the job
  • job name
  • job alias
  • job submission date
  • job start date
  • job completion date
You can also use this command to retrieve the job ID generated at submission time, which is required when running the jobstatus, jobdetails and jobcancel commands. To retrieve the job ID, specify the -name option.

Options

?
Displays help information.
-usr user name
Specifies the user name for a user authorized to perform operations on the command line. This option is required when security is enabled and the user name is not defined in the CLIConfig.properties configuration file (with the tdwb_user keyword).
-pwd password
Specifies the password for a user authorized to perform operations on the command line. This option is required when security is enabled and the password is not defined in the CLIConfig.properties configuration file (with the tdwb_pwd keyword).
-status status
Specifies the status of the jobs to be searched. Separate statuses using commas; spaces are not supported. Supported statuses are as follows:
0
all supported statuses
1
submitted
2
waiting for resources
3
resource allocation received
4
submitted to agent
5
running
6
cancel pending
7
canceling allocation
8
waiting for reallocation
10
bound
41
resource allocation failed
42
run failed
43
completed successfully
44
canceled
45
unknown job
46
job not started
48
error
-submitter submitter
Specifies the name of the user who submitted the job.
-name job_definition_name
Specifies the job name. This option returns the unique job ID, which can be used for retrieving information on and canceling jobs. This option supports the asterisk (*) wildcard character as described below:
as a single parameter
it must be enclosed in inverted commas, for example
C:\Program Files\TDWB\bin>jobquery -name "*"
This command returns a list of all submitted jobs.
to complete a job name
it does not require inverted commas, for example
C:\Program Files\TDWB\bin>jobquery -name batchsub*
This command returns a list of all submitted jobs starting with the batchsub suffix.
-alias job_alias
Specifies the job alias. The job alias is generated at submission time using the -alias option. For more information see jobsubmit command - Submitting jobs.
-sdf submit_date_from
Specifies a time range starting from the date when the job was submitted. The query is performed starting from the date you specified to the present date, unless the -sdt option is specified. Use both the -sdf and -sdt options to define a specific time range. Specify the date in the dd/MM/yyyy-hh:mm:ss format.
-sdt submit_date_to
Specifies a time range starting from the date when the job was submitted. The query is performed starting from the date when the HCL Workload Automation database was populated to the date you specified, unless the -sdf option is specified. Use both the -sdf and -sdt options to define a specific time range. Specify the date in the dd/MM/yyyy-hh:mm:ss format.
-jsdf job_start_date_from
Specifies a time range starting from the date when the job started. The query is performed starting from the date you specified to the present date, unless the -jsdt option is specified. Use both the -jsdf and -jsdt options to define a specific time range. Specify the date in the dd/MM/yyyy-hh:mm:ss format.
-jsdt job_start_date_to
Specifies a time range starting from the date when the job started. The query is performed starting from the date when the HCL Workload Automation database was populated to the date you specified, unless the -jsdf option is specified. Use both the -jsdf and -jsdt options to define a specific time range. Specify the date in the dd/MM/yyyy-hh:mm:ss format.
-jedf job_end_date_from
Specifies a time range starting from the date when the job completed. The query is performed starting from the date you specified to the present date, unless the -jedt option is specified. Use both the -jedf and -jedt options to define a specific time range. Specify the date in the dd/MM/yyyy-hh:mm:ss format.
-jedt job_end_date_to
Specifies a time range starting from the date when the job completed. The query is performed starting from the date when the HCL Workload Automation database was populated to the date you specified, unless the -jedf option is specified. Use both the -jedf and -jedt options to define a specific time range. Specify the date in the dd/MM/yyyy-hh:mm:ss format.
-configFile configuration_file
Specifies the name and path of a custom configuration file. This option is optional. If this option is not specified, the default configuration file is assumed. For more information on the configuration file, see Command-line configuration file.

Authorization

The user name and password for the command are defined in the CLIConfig.properties file. To override the setting defined in this file, you can enter the user name and password when typing the command. For more information on the CLIConfig.properties file, see Command-line configuration file.

Return Values

The jobquery command returns one of the following values:
0
Indicates that jobquery completed successfully.
< > 0
Indicates that jobquery failed.

Examples

  1. To retrieve the job ID for a job named CLIJSB11, type the following command:
    jobquery -usr john -pwd BCA12EDF -name CLIJSB11
    The following output is displayed. The job ID is associated to the Job Identifier key:
    Call Job Dispatcher to query jobs. There are 10 Jobs found for your request
    Details are as follows:
    
    Job Name: CLIJSB11
    Job Alias: alias
    Job Identifier: 617c9bf7095787c83e1c36744e569ceb
    Status: FAILED_running
    Job EPR: http://lab135200.romelab.it.abc.com:955
    /JDServiceWS/services/Job
    Job Submitter Name:
    Submit Time: Tue May 23 15:41:54 CEST 2006
    Start Time: Tue May 23 14:48:09 CEST 2006
    End Time: Tue May 23 14:48:09 CEST 2006
    Job Last Status Message:
    Job Duration: PT0S
    Returncode: 0
    Job Resource Name: LAB237010
    Job Resource Type: ComputerSystem
  2. To retrieve all jobs submitted by test_user in submitted, resource allocation failed, and canceled state, type the following command:
    jobquery -status 1,3,44 -submitter test_user

See Also

jobsubmit command - Submitting jobs