Previous Topic

Next Topic

Book Contents

Book Index

Command Reference

The syntax and a brief description of each Control-M/Analyzer command is provided below. Each command corresponds to an online Rule Definition parameter. The commands are grouped in the same manner as the Online parameters: Basic Rule commands; Data Selection commands (ON_ commands); Data Identification commands (WHEN, IF, ALWAYS); and DO commands (that are presented in alphabetical order).

For additional information about a command, refer to the corresponding parameter or statement earlier in this chapter.

Items enclosed in square brackets ([ ]) are optional. These items can be specified or omitted.

Table 275 Control-M/Analyzer Commands

Command

Syntax

Description

Options

ALWAYS

[LABEL name]

ALWAYS

Example

LABEL 'MUST'
ALWAYS
        DO ...

Unconditionally performs a processing unit (only for ON_DATA).

 

DO ADDSYM

DO ADDSYM
var
MEMSYM member
LIBSYM library

Example

DO ADDSYM VAR 'NEW_AE_VAR' MEMSYM '$AESYMS'
        LIBSYM 'M18.AE.LIB'

Adds a variable to a new AutoEdit member or to an existing AutoEdit member read by command DO GETMEM.

 

DO BLOCK

DO BLOCK name
[ARG arguments]

Example

DO BLOCK 'CHECK' ARG 'SUM,AVG,COUNTER'

Processes a different EXECUTE block (of the same rule) and optionally passes input and output arguments. An argument is referenced in the called block by the BARG## variable, where ## is the two digit number indicating the position of the argument when passed (for example, BARG01, BARG02, BARG03 ... ).

 

DO CALLUSER

DO CALLUSER name
[ARG arguments]

Example

DO CALLUSER 'M18ROUT' ARG 'SUM,AVG,COUNTER'

Executes a user routine.

 

DO COMMIT

DO COMMIT
[VAR variable]
method

Examples

DO COMMIT VAR 'DB_FOREIGN.TOTAL' NOW

DO COMMIT NONE

DO COMMIT VAR 'DB_FOREIGN.AVERAGE' EXCLUDE

Writes Control-M/Analyzer Database variables to the Database. If DO COMMIT is not specified in the rule, Database variables set during rule execution are committed at rule termination.

Options can be specified to determine which variables are committed, and when.

methods:
ALL
NONE
NOW
INCLUDE
EXCLUDE
DELETE

DO COND

DO COND condition
ODATE dateref
opt

Example

DO COND 'JOB_%%SYSJOBNAME_OK' ODATE '0305' ADD

Adds or deletes a prerequisite condition to or from the IOA Conditions file.

opt:
ADD
DEL

DO EXIT

DO EXIT

Immediately terminates the current block. Control passes to the statement that called the block if there is one.

 

DO EXTRACT

DO EXTRACT variable
LEVEL level
LINE line
FCOL fcol
TCOL tcol
[PROCESS process]
[TYPE type]

Examples

DO EXTRACT 'CURRENT' LEVEL 0 LINE +0 FCOL +10 TCOL +15

DO EXTRACT 'VEC%%I' LEVEL 0 LINE +0 FCOL +10 TCOL +15

DO EXTRACT 'AVG' LEVEL 0 LINE +0 FCOL +10 TCOL +15 TYPE AV

DO EXTRACT 'SUM' LEVEL 0 LINE +0 FCOL +10 TCOL +15 TYPE SU

Extracts data from a data source and stores the data in a Control-M/Analyzer variable. The extraction is relative to the WHEN command of the specified LEVEL.

This command cannot be used in EXECUTE blocks that contain an ON_DATA command.

type:
AV
SU

DO GETMEM

DO GETMEM
MEMSYM member
LIBSYM library

Example

DO GETMEM MEMSYM ‘$AESYMS’ LIBSYM ‘M18.AE.LIB’

Retrieves an AutoEdit member and makes its AutoEdit symbols available to the rule.

 

DO GOTO

DO GOTO
label-name

Example

DO GOTO 'CHECK'

Directs processing to statements in the current block identified by label name.
This command can only be used in EXECUTE blocks that contain an ON_DATA command.

 

DO PRINT

DO PRINT
DATA data string

Example

DO PRINT DATA 'THIS DATA WILL BE PRINTED IN THE BANKING REPORT'

Prints a data string to the Control-M/Analyzer Rule Activity report and to user files defined with the Dynamic Print facility.

 

DO PUTMEM

DO PUTMEM
MEMSYM member
LIBSYM library

Example

DO PUTMEM MEMSYM '$AESYMS' LIBSYM 'M18.AE.LIB'

Writes an AutoEdit member and its variables to the specified library.

 

DO REMARK

DO REMARK
DATA data string

Example

DO REMARK DATA 'THE DAILY SUM IS %%SUM'

Adds a user-defined remark about the Control-M/Analyzer invocation to the Rule Activity report and the Rule Activity display.

 

DO RULE

DO RULE name
[ARG arguments]

Example

DO RULE 'MYRULE' ARG 'SUM,AVG,COUNTER'

Executes a different rule, and optionally passes input and output arguments to the rule. An argument is referenced in the called block by the RARG## variable, where ## is the two digit number indicating the position of the argument when passed (for example, RARG01, RARG02, RARG03 ...).

 

DO SET

DO SET variable
EVAL value

Examples

DO SET   'I' EVAL '3'
DO SET   'STR' EVAL 'ABC'
DO SET   '&&I' EVAL 'I*500'

Initializes or modifies a Database, AutoEdit, or Local variable.

 

DO SHOUT

DO SHOUT
MSG message
[URGENCY urgency]
DEST destination

Examples

DO SHOUT MSG 'RULE RULFILE INITIALIZED' URGENCY 'R' DEST 'TSO-M18'

DO SHOUT MSG 'MESSAGE TO OPERATOR' URGENCY 'R' DEST 'OPER'

Issues a message to a TSO user, the operator console, or the IOA Log file.

 

DO SYSOUT

DO SYSOUT
OPT processing option
PRM class or destination
FRM sysout class

Example

DO SYSOUT OPT C PRM B FRM X

Specifies how a job output should be handled.

 

DO TERMINATE

DO TERMINATE
RESULT result
USER_CODE user code

Examples

DO TERMINATE RESULT OK

DO TERMINATE RESULT NOTOK USER_CODE 2222

Ends rule execution, specifying a result and a user return code or abend code.

result:
OK
NOTOK
TOLER
ABEND

EXECUTE

EXECUTE block name
[UPON condition]

Example

EXECUTE 'INPUT' UPON 'SYSJOBNAME NE M18CHKA'

Names the current EXECUTE block and specifies any UPON criteria required for its execution.

This command must always be followed by command ON_.

 

HEADER

HEADER
OWNER user id>
[CREATOR user id]
[GROUP group]
[DATE date]
[TIME time]
[DESC description]

Example

HEADER OWNER 'M18' CREATOR 'M18B'
GROUP 'FOREIGN-CURR' DATE '050599'  TIME '153005'
DESC 'FOREIGN CURRENCY BALANCING'

Specifies basic information that describes the rule.

 

IF

[LABEL name]
IF condition
[ELSE]

Example

IF  'SUM GT 1000000'
DO ...
IF  'AVG GT  5000 AND AVG LT 10000'
DO...
IF  'ISLEAP(YEAR)'
       DO PRINT DATA  %%YEAR IS A LEAP YEAR'
ELSE
       DO PRINT DATA  %%YEAR IS NOT A LEAP YEAR'
LABEL 'CHECK'
IF 'LENGTH(STR) GT 5'
       DO ...
IF 'SUBSTR(STR,1,3) EQ ''ABC'''
DO ...
LABEL 'ROOT1'
IF '(((-B)+SQRT(POW(B,2)-4*A*C))/(2*A)) GT 0'
       DO ...

Conditionally performs a processing unit based on Boolean logic (only for ON_DATA).

The IF condition is evaluated. If true, subsequent DO statements are performed. If false, subsequent DO statements are skipped. If ELSE is specified, the DO statements following the ELSE are performed when the IF condition evaluates to false and skipped when the IF condition evaluates to true.

 

ON_CLASS

ON_CLASS
CLASS class
[EXTWTR extwtr]
[DEST destination]
[FORM]
[MODE mode]
[LINECT linect]
[DATASTAMP n]

Example

ON_CLASS CLASS 'X' DEST 'U2098' FORM 'STD'  EXTWRT 'SYS01'
ON_PARM MODE PG LINECT 6

Examines sysouts created by the current job, in a specified class, and (optionally) for a specified EXTWTR, DEST and FORM.

MODE:
DS
PG

DATA
STAMP:
blank
1
2

ON_DATA

ON_DATA

Example

ON_DATA

Examines Control-M/Analyzer variables.

 

ON_DB2

ON_DB2
SUBSYSTEM_ID subsystem
SQL_SELECT statement
ON_PARM
[MODE mode]
[LINECT linect]
[DATASTAMP n]

Example

ON_DB2 SUBSYSYEM_ID ’X’  SQL_SELECT ’EMPNAME, EMPSALFROM EMPTABLE WHEN EMPSAL>30000’ MODE PG LINECT 60

Indicates that the data to examine is from a DB2 table. The dynamic SQL facility is used to examine this data.

MODE
DS
PG

DATA
STAMP:
blank
1
2

ON_DD

ON_DD
DD ddname
[MODE mode]
[LINECT linect]
[DATASTAMP n]

Example

ON_DD DD 'MYDD' ON_PARM MODE PG LINECT 60

Examines a file referenced by a specified DD statement of the current step.

MODE
DS
PG

DATA
STAMP:
blank
1
2

ON_DSN

(For Control-D users only)

ON_DSN
CDAM criteria
[MODE mode]
[LINECT linect]
[DATASTAMP i]

Example

ON_DSN 'LAST=YES,JOBNAME=M33CDMZ,DDNAME=$JES2LOG,
PREFIX=D2PRSV' ON_PARM MODE PG LINECT 60

Examines a specified CDAM file. See CDAM in the Control-D User Guide.

MODE:
DS
PG

DATA
STAMP:
blank
1
2

ON_FILE

ON_FILE
FILE name
[MODE mode]
[LINECT linect]
[DATASTAMP n]

Example

ON_FILE 'M18.SEQ.TEST' ON_PARM MODE PG
LINECT 60

Examines a specified sequential file.

MODE:
DS
PG

DATA
STAMP:
blank
1
2

ON_PAGE

(For Control-D users only)

ON_PAGE
[MODE mode]
[LINECT linect]
[DATASTAMP n]

Example

ON_PAGE ON_PARM MODE PG LINECT 60

Examines CDAM pages that have satisfied Control-D WHEN criteria.

MODE:
DS
PG

DATASTAMP:
blank
1
2

ON_
SYSDATA
(For Control-M and Control-M /Restart users only)

ON_SYSDATA
[MODE mode]
[LINECT linect]
[DATASTAMP n]

Example

ON_SYSDATA ON_PARM MODE PG LINECT 60

Examines Control-M SYSDATA job sysouts archived by Control-M/Restart.

MODE:
DS
PG

DATASTAMP:
blank
1
2

ON_SYSOUT

ON_SYSOUT
DD ddname
[PROC procstep]
[PGM pgmstep]
[JOBNM job name]
[MODE mode]
[LINECT linect]
[DATASTAMP n]

Example

ON_SYSOUT DD 'SYSUT2' PROC 'STEP00'
PGM 'CTBREP' JOBNM 'ACTG1' ON_PARM MODE PG LINECT 60

Examines a specified sysout previously created by a step in the specified job. If a job name is not specified, JOBNM defaults to the current job.

MODE:
DS
PG

DATA
STAMP:
blank
1
2

ON_VSAM

ON_VSAM
FILENAME dsn
[FIRSTKEY key / rba]
[LASTKEY key / rba]
T  ESDS / RRDS / KSDS

Example

ON_VSAM FILENAME 'ACTG_INP' T 'RRDS'

Examines a KSDS, RRDS or ESDS type VSAM file. Key can be specified for KSDS files. rba can be specified for RRDS and ESDS files.

 

WHEN

WHEN
    FLINE [prefixfrom line TLINE  [prefixto line
    FCOL [prefix]+-from col TCOL  [prefixto col
    SEARCH string
    [STOPWHEN
   FLINE [prefixfrom line
TLINE  [prefixto line
    FCOL [prefixfrom col
TCOL  [prefixto col
    SEARCH string]
    [AND/OR]

Examples

WHEN  FLINE 6 TLINE 7 FCOL 1 TCOL 100
      SEARCH '.NE. SUNDAY'

WHEN  FLINE 6 TLINE 7 FCOL 1 TCOL 100
      SEARCH 'DEPT. A'
      STOPWHEN FLINE 6 TLINE 7 FCOL 1 TCOL 100
      SEARCH 'DEPT. B'
AND
WHEN  FLINE 12 TLINE 59 FCOL 6 TCOL 15
      SEARCH 'DEBIT'

Information required to conduct a string search on data (except for ON_DATA).

prefix is an optional data search reference point. PG search starts at beginning of the current page. DS search starts at beginning of the dataset.

string can contain: .NE., .GE., .GT., .LE., or .LT.

from line, to line can be absolute line numbers (for example, 007, 009) or relative line numbers (for example, -2, +0) defined as offsets from current from line and to line positions.

from col, to col can be absolute line numbers (for example, 025, 032) or relative line numbers (for example, -5, +2) defined as offsets from current from col and to col positions.

prefix:
DS
PG
L
C

Parent Topic

Rule Definition