R3_GET_JOBS

Selects SAP jobs and lists the result in the activation report or a file.

Transaction: SM37
Interface: AE and Standard

Syntax

R3_GET_JOBS

Syntax

Description/Format

NAME=

Selection of one or more jobs by name.
Format: script literal or AE name

In connection with JOBCOUNT (SAP job number), a unique SAP job can be clearly identified.
The wildcard character "*" can be used to select several jobs (e.g. 'xxx*').

Parameter

Further selection criteria in the form of a keyword and an assignment.

Non-specified parameters use default values. Formats are valid for the keyword assignment. 

JOBCOUNT=

Number of the SAP job.
Format: script literal

In combination with the NAME (SAP job name), a unique SAP job can be clearly identified.

GROUP=

Selection of jobs by groups (such as "xxx*").
Format: script literal or AE name

Default value: "*" 

USER=

Selection of jobs by users (such as "xxx*").
Format: script literal or AE name

Default value: "*" 

START_D[ATE]=

Planned start date for the job's execution.
Format: script literal or AE name

Date format: YYYYMMDD
Default value: "20010101"

START_T[IME]=

Planned start time for the job's execution.
Format: script literal or AE name

Time format: HHMMSS
Default value: "000000"

END_D[ATE]=

Planned end date for the job's execution
Format: script literal or AE name

Date format: YYYYMMDD
Default value: current date

END_TIME=

Planned end time for the job's execution
Format: script literal or AE name

Time format: HHMMSS
Default value: "235959"

NO_DATE=

Jobs without start date.
Format: script literal or AE name

Allowed values: "" (default value) and "X"

WITH_PRED=

Jobs with start after predecessor.
Format: script literal or AE name

Allowed Values: "" (default value) and "X"

EVENT_ID=

Jobs that are linked to an event: Name of the event.
Format: script literal or AE name

EVENT_PARM=

Jobs that are linked to an event: Parameter of the event.
Format: script literal or AE name

PRELIM=

Jobs of status "Scheduled".
Format: script literal or AE name

Allowed Values: "" (default value) or "X"

SCHEDUL=

Jobs of status "Released".
Format: script literal or AE name

Allowed Values: "" (default value) or "X"

READY=

Jobs of status "Ready".
Format: script literal or AE name

Allowed values: "" (default value) or "X"

RUNNING=

Jobs with status "Active".
Format: script literal or AE name

Allowed values: "" (default value) or "X"

FINISHED=

Jobs of status "Finished".
Format: script literal or AE name

Allowed values: "" (default value) or "X"

ABORTED=

Jobs of status "Terminated".
Format: script literal or AE name

Allowed values: "" (default value) or "X"

NOFOUND=

Handling if no jobs are found by selection.
Format: script literal or AE name

Allowed values: "NORMAL" (default value) and "ABEND"

"NORMAL" - Script execution continues, the AE job ends normally.
"ABEND" - Script execution stops, the AE job ends abnormally.

FILE= 

Name of the file in which the result (located SAP jobs) should be saved.
Format: script literal

The result of the selection is not output to the activation report if this parameter is used. 

ENCODING=

This script element can be used to select background jobs in SAP. The selection criteria are assigned as parameters. The parameters correspond to the fields of the SAP Dictionary Structure BAPIXMJSEL. Use the dictionary or BAPI Browser for detailed information about the individual fields.

The result of the selection is either written to the activation report or a file. There is a line for each located SAP job. The structure of lines between the activation report and the file are different.

The file uses columns. The first line of the file contains information about the column size and contents. The individual lines correspond to these specifications. The first 33 characters contain the respective SAP job's name, the other 9 characters its number.

In the activation report, all information within a line is separated by a semicolon. Additionally, a timestamp and an AE message number is output to the beginning of the line.

Tip: You can use scripts in the Post Process page to analyze the result of the selection. Use the following script functions:

For more information, see Process Pages

Note: By default, created files are saved on the computer on which the agent is installed  (such as R3_GET_JOB_SPOOL; FILE=).

Examples

The first example selects all scheduled SAP jobs that start with "REL".

R3_GET_JOBS NAME="REL*",PRELIM="X"

The result is written to the activation report and can look similar to the following lines:

20000922/134303.567 - U2004943 ;RELEASE;13450801
20000922/134303.567 - U2004943 ;RELEASE;13455501
20000922/134303.567 - U2004943 ;RELEASE;16221501
20000922/134303.567 - U2004943 ;RELEASE;16225101
20000922/134303.567 - U2004943 ;RELEASE;16234801

The second example selects all SAP jobs of the name "EU_REORG" and the status "Finished". The selection result is saved in a file.

R3_GET_JOBS NAME='EU_REORG',FINISHED='X',FILE='jobs.txt'

The first lines of the file could look as shown below:

COL=LENGTH,LENGTH_TAB='33=JOBNAME,9=JOBCOUNT'
EU_REORG                         01404301
EU_REORG                         01405401

See also:

seealso

About SAP JCL