Using Orchestration Query Language
You can use the essential Orchestration Query Language (OQL) keywords and syntax to effectively write queries.
You can monitor the IBM® Workload Scheduler production plan environment, both distributed and z/OS, by using the OQL, which applies to REST API V2, Orchestration CLI, and the Orchestration Monitor of the Dynamic Workload Console. Write queries for items in your database and retrieve required results easily and quickly by using the OQL syntax.
An OQL query begins with an expression, which is composed of different conditions, known as queryTerms. A queryTerm is the minimum condition of a OQL construction, for example jobStreamName = test1.
QueryTerms include three main elements: a field, a comparison_operator, and a value. The fields and the values of the query are case-sensitive.
The field must begin with a letter. After the first letter, the field can contain the following characters:
- 0 - 9
- a - z
- A - Z
- _
- -
- .
- Integers, both positive and negative.
- Strings in single quotation marks (').
- Duration, based on ISO 8601 standard. Duration is expressed in
P[n]Y[n]M[n]DT[n]H[n]M[n]S
format, where[n]
replaces the value of each time and date element. For example, to express a duration of 4 hours and 20 seconds, the format to use isPT4H20S
. - Instant, based on ISO 8601 standard. Instant is expressed in YYYY-MM-DDThh:mm:ss.milliseconds format. For example, to express the instant for December 1st, 2025 at 11 PM, the format to use is 2025-12-01T23:00:00.000Z.
- Identifier (ID) based on Universally Unique Identifier (UUID) standard.
OQL syntax keywords and comparison operators
The following table details OQL keywords and comparison operators, both of which are essential for constructing effective queries.
Keywords | Description |
---|---|
AND | Returns the results that satisfy all the conditions separated by AND. It is case insensitive. |
OR | Returns the results that satisfy at least one of the conditions separated by OR. It is case insensitive. |
( | Opens a priority expression. |
) | Closes a priority expression. |
[ | Opens a list. |
] | Closes a list. |
= | Returns all the elements equal to the specified element. Numbers, strings, or one of these keywords can follow the keyword: true, false, or null. |
!= | Returns all the elements different from the given one. Numbers, strings, or one of these keywords can follow the keyword: true, false, or null. |
<= | Returns all the elements that are less than or equal to the specified keyword. Only numbers or strings can follow. |
>= | Returns all the elements that are greater than or equal to the specified keyword. Only numbers or strings can follow. |
< | Returns all the elements that are less than the specified keyword. Only numbers or strings can follow. |
> | Returns all the elements that are greater than the specified keyword. Only numbers or strings can follow. |
IN | Returns items that the specified list includes. |
NOT IN | Returns items that the specified list does not include. |
LIKE | Returns elements that match the specified pattern. The
accepted characters are as follows:
|
NOT LIKE | Returns elements that do not match the specified pattern. The
accepted characters are as follows:
|
ORDER BY | Orders the query results according to the specified fields.
You can use the keyword at the end of the construction. By
default, the field is sorted in ascending order. The accepted
values are as follows:
|
, | Separates values inside a list. |
. | Specifies a subfield of an item. |
true | Represents the Boolean value true . |
false | Represents the Boolean value false . |
null | Represents the null value. |
OQL syntax fields for workstations
Unless specified, the fields and the values listed in the table apply both to distributed and z/OS environments.
Field name | Description |
---|---|
activeFlags ![]() |
The flags of the workstation. Supported values are:
Example:
|
activeStates | The statuses of the workstation. Supported values
are:![]()
![]()
|
available ![]() |
The workstation is flagged as available. Supported values are
true or
false .Example:
|
description ![]() |
The description of the
workstation. Example:
|
domainName ![]() |
The name of the domain within which the workstation is
hierarchically
organized. Example:
|
folder ![]() |
The name of the folder where the workstation is
saved. Example:
|
id | The identifier of the
workstation. Example:
|
jobmanUp ![]() |
Identifies whether the agent is running or not. Supported
values are true or
false .Example:
|
name | The name of the
workstation. Example:
|
remoteEngineType ![]() |
The type of remote engine on which the current remote
workstation is defined. Supported values are Z
for z/OS engines, and D for distributed
engines.Example:
|
reporting ![]() |
The type of reporting. Supported values
are:
Example:
|
resource1Info.usedForControl ![]() |
The job must be submitted only if the requested resource
amount is available. Supported values are true
or
false .Example:
|
resource2Info.usedForControl ![]() |
The job must be submitted only if the requested resource
amount is available. Supported values are true
or
false .Example:
|
resource2Info.usage ![]() |
The type of usage defined for resource 2. Supported values
are: Example:
|
type | The type of workstation. Supported values are:![]()
![]()
Example:
|
OQL syntax fields for job streams
Unless specified, the fields and the values listed in the table apply both to distributed and z/OS environments.
Field name | Description |
---|---|
aliasJobStreamName ![]() |
The alias name of the job
stream. Example:
|
commonStatus | The external status of the job stream in plan. The supported
values are: ![]()
![]()
|
compositeStatus.status | The internal status of the job stream in plan. Supported
values are: ![]()
![]()
|
dependencies.dependencyStatus![]() |
The status of the job stream dependency. Supported values
are:
Example:
|
dependencies.jobId ![]() |
The identifier of the job instance on which the job stream
depends. Example:
|
dependencies.folderOriginalName ![]() |
The name of the folder where the job dependency is
saved. Example:
|
dependencies.jobStreamName ![]() |
For dependencies on jobs, the name of the job stream to which the job belongs. For dependencies on job streams, the name of the job stream. Example:
|
dependencies.jobName ![]() |
The name of the job on which the job stream
depends. Example:
|
dependencies.jobStreamFolder ![]() |
For dependencies on jobs, the name of the folder of the job stream to which the job belongs. For dependencies on job streams, the name of the folder of the dependent job stream. Example:
|
dependencies.jobStreamId ![]() |
For dependencies on jobs, the id of the job stream to which the job belongs. For dependencies on job streams, the id of the dependent job stream. Example:
|
dependencies.jobStreamName ![]() |
For dependencies on jobs, the name of the job stream to which the job belongs. For dependencies on job streams, the name of the dependent job stream. Example:
|
dependencies.jobStreamWorkstation ![]() |
For dependencies on jobs, the name of the workstation of the job stream to which the job belongs. For dependencies on job streams, the name of the workstation of the dependent job stream. Example:
|
dependenciesStats.numberOfDependencies ![]() |
The number of dependencies of the job stream. Supported
operators are = and
!= .Example:
|
dependenciesStats.numberOfFileDependencies ![]() |
The number of dependencies of the job stream of type
File . Supported operators are
= and
!= .Example:
|
dependenciesStats.numberOfInternetworkDependencies ![]() |
Number of dependencies of the job stream of type
Internetwork dependency . Supported
operators are = and
!= .Example:
|
dependenciesStats.numberOfJobDependencies ![]() |
The number of job dependencies of the job stream. Supported
operators are = and
!= .Example:
|
dependenciesStats.numberOfJobStreamDependencies ![]() |
The number of job stream dependencies of the job stream.
Supported operators are = and
!= .Example:
|
dependenciesStats.numberOfPromptDependencies ![]() |
The number of dependencies of the job stream of type
Prompt . Supported operators are
= and
!= .Example:
|
dependenciesStats.numberOfResourceDependencies ![]() |
The number of dependencies of the job stream of type
Resource . Supported operators are
= and
!= .Example:
|
dependenciesStats.numberOfUnresolvedDependencies ![]() |
The number of dependencies of the job stream that have not
been satisfied. Supported operators are = and
!= .Example:
|
folder![]() |
The name of the folder within which the job stream is
saved. Example:
|
folderId![]() |
The identifier of the folder within which the job stream is
saved. Example:
|
id ![]() |
The identifier of the job
stream. Example:
|
jobs.dependencies.jobStreamId ![]() |
The identifier of the job stream to which the dependency of
the job
belongs. Example:
|
jobStreamStats.numberOfAbendedJob ![]() |
The number of jobs in ABEND status within
the job stream. Supported operators are = and
!= .Example:
|
jobStreamStats.numberOfCurrentNodes ![]() |
The number of current nodes within the job stream. Supported
operators are = and
!= .Example:
|
jobStreamStats.numberOfExecutingJob ![]() |
The number of jobs that are currently running within the job
stream. Supported operators are = and
!= .Example:
|
jobStreamStats.numberOfFailedJob ![]() |
The number of jobs that are in FAIL status
within the job stream. Supported operators are
= and
!= .Example:
|
jobStreamStats.numberOfJob ![]() |
The total amount of jobs within the job stream. Supported
operators are = and
!= .Example:
|
jobStreamStats.numberOfNotRunningJob ![]() |
The number of jobs that are currently not running within the
job stream. Supported operators are = and
!= .Example:
|
jobStreamStats.numberOfSkelJob ![]() |
The number of jobs in SKEL status within the
job stream. Supported operators are = and
!= .Example:
|
jobStreamStats.numberOfSuccessfullJob ![]() |
The number of jobs in SUCCESS status within
the job stream. Supported operators are = and
!= .Example:
|
jobStreamStats.numberOfUndecidedJob ![]() |
The number of jobs in unknown status within the job stream.
Supported operators are = and
!= .Example:
|
jsDefinitionFlags.carriedForward ![]() |
The job stream is flagged as carried
forward . Supported values are true or
false .Example:
|
jsOptions.carryForward ![]() |
The job stream is to be carried forward. Supported values are
true or
false .Example:
|
jsOptions.monitored | The job stream is to be monitored. Supported values are
true or
false .Example:
|
key ![]() |
The complete key that identifies the job
stream. Example:
|
limit ![]() |
The limit value set for the job
stream. Example:
|
name | The name of the job
stream. Example:
|
occurrenceToken ![]() |
The unique token that identifies the job stream.
|
originalJobStreamName | The name of the job stream before any change was
performed. Example
|
origPriority ![]() |
The original priority value set for the job
stream. Example:
|
pendingPredecessor ![]() |
The job stream has predecessor instances that are pending.
Supported values are true or
false .Example:
|
priority | The priority value set for the job
stream. Example:
|
schedTime | The scheduled time of the job
stream. Example:
|
timeInfo.actualEndTime | The time at which the job stream ended, that is the real end
time. Example:
|
timeInfo.actualStartTime | The time at which the job stream started, that is the real
start
time. Example:
|
timeInfo.elapsedTime ![]() |
The elapsed time of the job stream, that is the real
duration. Supported operators are = and
!= .Example:
|
timeInfo.estimatedDuration ![]() |
The estimated duration of the job stream. Supported operators
are = and
!= .Example:
|
timeRestrictions.deadlineTime | The time within which the job stream should
complete. Example:
|
timeRestrictions.startTime | The start time set for the job
stream. Example:
|
timeRestrictions.untilTime ![]() |
The latest time the job stream can be
launched. Example:
|
workstation | The workstation where the job stream
runs. Example:
|
OQL syntax fields for jobs
Unless specified, the fields and the values listed in the table apply both to distributed and z/OS environments.
Field name | Description |
---|---|
dependencies.dependencyStatus ![]() |
The status of the job dependency. Supported values are:
Example:
|
dependencies.jobId ![]() |
The identifier of the job instance on which the job
depends. Example:
|
dependencies.jobKey.name ![]() |
The name of the job
dependency. Example:
|
dependencies.jobStreamFolder ![]() |
For dependencies on jobs, the name of the folder of the job stream to which the job belongs. For dependencies on job streams, the name of the folder of the dependent job stream. Example:
|
dependencies.jobStreamId ![]() |
For dependencies on jobs, the id of the job stream to which the job belongs. For dependencies on job streams, the id of the dependent job stream. Example:
|
dependencies.jobStreamName ![]() |
For dependencies on jobs, the name of the job stream to which the job belongs. For dependencies on job streams, the name of the job stream. Example:
|
dependencies.jobStreamWorkstation ![]() |
For dependencies on jobs, the name of the workstation of the job stream to which the job belongs. For dependencies on job streams, the name of the workstation of the dependent job stream. Example:
|
dependenciesStats.numberOfFileDependencies ![]() |
The number of dependencies of the job of type
File . Supported operators are
= and
!= .Example:
|
dependenciesStats.numberOfInternetworkDependencies ![]() |
Number of dependencies of the job of type
Internetwork dependency . Supported
operators are = and
!= .Example:
|
dependenciesStats.numberOfJobDependencies ![]() |
The number of job dependencies of the job. Supported
operators are = and
!= .Example:
|
dependenciesStats.numberOfJobStreamDependencies ![]() |
The number of job stream dependencies of the job. Supported
operators are = and
!= .Example:
|
dependenciesStats.numberOfPromptDependencies ![]() |
The number of dependencies of the job of type
Prompt . Supported operators are
= and
!= .Example:
|
dependenciesStats.numberOfResourceDependencies ![]() |
The number of dependencies of the job of type
Resource . Supported operators are
= and
!= .Example:
|
dependenciesStats.numberOfUnresolvedDependencies ![]() |
The number of dependencies of the job that have not been
satisfied. Supported operators are = and
!= .Example:
|
folder ![]() |
The name of the folder within which the job is saved.
Example:
|
folderId ![]() |
The identifier of the folder within which the job is
saved. Example:
|
id ![]() |
The identifier of the
job. Example:
|
jobDefinition.isCommand ![]() |
The job definition is a command. Supported values are
true if the job definition is a command, or
false if the job definition is a script
file.Example:
|
jobDefinition.key.name ![]() |
The name of the job
definition. Example:
|
jobDefinition.recoveryOption ![]() |
The recovery options set for the job definition. Supported
values are:
Example:
|
jobDefinition.taskType ![]() |
The task type of the job
definition. Example:
|
jobDefinition.userLogin ![]() |
The username of the job
definition. Example:
|
jobDefinition.workstation ![]() |
The name of the workstation on which the job definition
runs. Example:
|
jobDefinition.workstationKey ![]() |
The name of the workstation on which the job definition
runs. Example:
|
jobDefinitionFlags.monitored ![]() |
The job must be monitored. Supported values are
true or false . |
jobOptions.critical ![]() |
The critical option is set for the job.
Supported values are true or
false .Example:
|
jobOptions.every ![]() |
The every option is set for the job.
Supported values are true or
false .Example:
|
jobOptions.noOperation | The No operation option is set for the job.
Supported values are true or
false .Example:
|
jobOptions.requiresConfirmation | The Requires confirmation option is set for
the job. Supported values are true or
false .Example:
|
jobruns.actualWorkstation ![]() |
The name of the workstation where the job actually
runs. Example:
|
jobruns.commonStatus | The external status of the job runs. Supported values are:
![]()
![]()
|
jobruns.compositeStatus.status | The internal status of the job runs. Supported values are:
![]()
![]()
|
jobruns.elapsedTime ![]() |
The elapsed time of the job run instance, that is the real
duration. Example:
|
jobruns.estimatedDuration ![]() |
The estimated duration of the job run
instance. Example:
|
jobruns.jobNumber | The total number of jobs runs. Supported operators are
= and
!= .Example:
|
jobruns.maxDurationGone ![]() |
The duration of the run is higher than the maximum duration
value. Supported values are true or
false .Example:
|
jobruns.minDurationNotReached ![]() |
The duration of the run is lower than the minim duration
value. Supported values are true or
false .Example:
|
jobruns.reruntype ![]() |
The type of rerun. Supported values
are:
Example:
|
jobruns.returnCode ![]() |
The return code of the job run
instance. Example:
|
jobruns.step ![]() |
The alias name of the job run
instance. Example:
|
jobruns.timeInfo.actualEndTime ![]() |
The time at which the job run instance
ended. Example:
|
jobruns.timeInfo.actualStartTime ![]() |
The time at which the job run instance
started. Example:
|
jobruns.errorCode ![]() |
The error code of the first operation in error status within
the job
run. Example:
|
jobs.jobDefinition.workstationName | The name of the workstation where the job definition
referenced by the job instance is
saved. Example:
|
jobStreamId | The identifier of the job stream within which the job is
saved. Example:
|
jobStreamName | The name of the job stream within which the job is
saved. Example:
|
jobStreamWorkstation | The name of the workstation on which runs the job stream
within which the job is
saved. Example:
|
name | The name of the
job. Example:
|
priority | The priority value set for the
job. Example:
|
jobruns.timeDependent ![]() |
The evaluation of the AT time value of the dependency is
active. Supported values are true or
false .Example:
|
timeRestrictions.untilAction ![]() |
The action set for a job when the until time has expired but
the job has not yet started. Supported values are:
Example:
|
timeRestrictions.untilTime ![]() |
The latest time a job can be
launched. Example:
|
workstation | The workstation where the job
runs. Example:
|
OQL syntax fields for resources
The filtering of resources is only available in distributed enviroments.
Field name | Description |
---|---|
id | The id of the
resource. Example:
|
name |
The name of the resource. Example:
|
folder | The folder of the
resource. Example:
|
workstation | The workstation of the
resource. Example:
|
workstationFolder | The folder where the workstation of the resource is
saved. Example:
|
quantity | The entire quantity of the
resource. Example:
|
quantityInUse | The quantity of the resource that is currently in
use. Example:
|
quantityAvailable | The quantity of the resource that is
available. Example:
|
status | The status of the resource. Supported values
are:
Example:
|
Examples
- Workstation
-
- The following example shows a query that retrieves all the
workstations in plan that are either linked and running, or they
are a fault-tolerant agent
on a domain that is different from
MASTERDM
:(activeStates IN ['LINKED'] AND jobmanUp = true) OR (type IN ['FTA'] AND domainName != 'MASTERDM')
- The example below shows a query that retrieves all the
workstations that have all the following characteristics:
- They have a name that contains the sequence of letters
NEW
- They are either agent, fault-tolerant agent, or domain manager type workstations
- They are in a domain whose name starts with letter
M
- They are in
UNLINKED
state - They are not currently running
- They are contained in a folder whose name ends with
letter
A
name LIKE '@NEW@' AND type IN ['AGENT','FTA','DOMAIN_MANAGER'] AND domainName LIKE 'M@' AND activeStates IN ['UNLINKED'] AND jobmanUp = false AND folder LIKE '/@A/'
- They have a name that contains the sequence of letters
- The following example shows a query that retrieves all the
workstations in plan that are either linked and running, or they
are a fault-tolerant agent
on a domain that is different from
- Job stream
-
- The example below shows a query that retrieves either:
- Job streams whose name does not contain the word
JS
within and whose limit is greater than 1 and less or equal to 3Or
- Job streams whose name contains the letter
A
and that has a priority greater than 9 and less or equal to 100
(name NOT LIKE '@JS@' AND (limit > 1 AND limit <= 3)) OR (name LIKE '@A@' AND (priority > 9 AND priority <= 100))
- Job streams whose name does not contain the word
- The following example shows a query that retrieves either:
- Job streams that are in WAITING
and READY status and that have a
schedule time between March, 1st 2025 at 12 AM and
March, 10th 2025 at 11:59 PM
Or
- Job streams that are in ERROR and BLOCKED status and that have a schedule time between January, 1st 2025 at 12 AM and February, 25th 2025 at 11:59 PM
(commonStatus IN ['WAITING','READY'] AND (schedTime >= '2025-03-01T00:00:00.000Z' AND schedTime <= '2025-03-10T23:59:59.000Z')) OR (commonStatus IN ['ERROR','BLOCKED'] AND (schedTime >= '2025-01-01T00:00:00.000Z' AND schedTime <= '2025-02-25T23:59:59.000Z'))
- Job streams that are in WAITING
and READY status and that have a
schedule time between March, 1st 2025 at 12 AM and
March, 10th 2025 at 11:59 PM
- The following example shows a query that performs a basic
search. Using regular plan filters, the query would correspond
to
/WSFOLDER/WS#/JSFOLDER/JSNAME
:name = 'JSNAME' AND workstation = '/WSFOLDER/WS' AND folder ='/JSFOLDER'
- The below query retrieves all job streams whose status is either
SUCC
,ABEND
, orFAIL
, and whose start time is prior to 2025/02/27 11:15:00:000 UTC:compositeStatus.status IN ['SUCC','ABEND','FAIL'] AND timeInfo.actualStartTime < '2025-02-27T11:15:00.000Z'
- The following example shows a query that retrieves all the job
streams that contain 3 jobs within, and that either:
- Have priority value set to 101 and are in
RUNNING
status
Or
- Are on folder and on a workstation whose name starts
with
/WS
((priority = 101 AND commonStatus = 'RUNNING') OR (workstation = '/WS@' AND folder = '/')) AND jobStreamStats.numberOfJob = 3
- Have priority value set to 101 and are in
RUNNING
status
- The example below shows a query that retrieves either:
- Job
-
- The following example shows a query that retrieves all jobs
that:
- Have a name that starts with the letter
A
- Are part of the job stream named
JOBS
/WORKSTATION
, or that belong to job streams scheduled on/WORKSTATION
. Results are sorted by name in descending order:name LIKE 'A@' AND (workstation = '/WORKSTATION' OR jobStreamWorkstation = '/WORKSTATION') AND jobStreamName = 'JOBS' ORDER BY name DESC
- Have a name that starts with the letter
- The following query retrieves all jobs that are critical and
that either are not in
FAIL
,ABEND
, andHOLD
, or have been cancelled:(jobruns.compositeStatus.status NOT IN ['FAIL','ABEND','HOLD'] OR jobruns.compositeStatus.canceled = true ) AND jobOptions.critical = true
- The below query retrieves all jobs that have a single
dependency, excluding those that have completed with either
SUCCESSFUL
orERROR
status:dependenciesStats.numberOfJobDependencies = 1 AND jobruns.commonStatus NOT IN ['SUCCESSFUL','ERROR']
- The following example shows a query that retrieves all jobs
that:
- Resource
-
- The following example shows a query that retrieves all resources
that:
- Have a name that contains the word
RES
- Have the quantity in use value equal to 3
- Are in
AVAILABLE
status
name LIKE '@RES@' AND quantityInUse = '3' AND status in ['AVAILABLE']
- Have a name that contains the word
- The following query retrieves all resources that have a quantity
available value that is either 5 or 9, and that are saved in a
folder named
ROME
:(quantityAvailable = '5' OR quantityAvailable = '9' ) AND folder = 'ROME'
- The following example shows a query that retrieves all resources
that: