Previous Topic: EVENT(event_name,option)Next Topic: LABEL(option)


IF(condition & condition ...)

Controls the CAIENF command processing that is based on system variables. If the condition is true, all control options following the IF command are executed. Execution stops when an ENDIF command is encountered. If the condition is false, the set of commands between the IF and ENDIF commands is purged and a message is sent to the console.

Note: Do not use blanks between variables and operators. Any blank that is encountered is deciphered as the end of the IF statement.

Option

Description

condition

A condition consists of a variable and a value joined by an operator. For example,

variable=value.

variable

Replace variable with one of the following items:

SYSPLEX an IBM-defined variable

SYSNAME an IBM-defined variable

SYSCLONE an IBM-defined variable

CCISYSID a CAIENF startup option

SMFID the System Management Facility ID

operator

One of the following operators is required.

=

¬=

!=

<=

>=

>

<

value

Replace value with the appropriate value for the variable you have selected. Values are in EBCIDIC and must be enclosed in single quotes; if the quotes are omitted, value is treated first as a variable and then as a value.

Valid values for each variable are listed in this table.

SYSPLEX

Name of your sysplex. The length of the name can be up to eight bytes of character data; if not specified, the default LOCAL is used.

The name is defined in member COUPLExx or LOADxx in SYS1.PARMLIB.

SYSNAME

Name of your system. The length of the name can be up to eight bytes of character data; if not specified, the processor ID is used as the default.

The name is defined in the IEASYMxx or IEASYSxx sysname operand.

Note: If the same SYSNAME appears more than once in the IF command, specify SYSCLONE for each duplicate SYSNAME.

SYSCLONE

Abbreviation for the name of the system, up to two bytes of character data in length. If not specified, defaults to the last two characters of SYSNAME.

SYSCLONE is defined in the IEASYMxx member of SYS1.PARMLIB.

CCISYSID

Value of the CAICCI system ID for this system. The value length can be up to eight bytes of character data.

CCISYSID is defined in member ENFPARMS of SYS1.PARMLIB

Note: CCISYSID must be specified before using this variable in ENFPARMS.

SMFID

SMF system ID. The value length can be up to four bytes of character data. If not specified in SMPFRMxx, it defaults to the four-digit processor model number.

SMFID is defined in the SID operand of member SMFPRMxx in SYS1.PARMLIB.

User-defined

Name of a variable defined by you that can be up to eight bytes of character data in length.

User-defined variables are defined in member IEASYMxx of SYS1.PARMLIB.

Note: For instructions to define these symbolics, see the IBM INIT and Tuning Reference.

When using symbolics you define in your ENFPARMS, do not code the "&". and ending ".".

An example showing an IBM Static System Symbolic definition. In this example, the variable is specified as RELEASE, not &RELEASE.

SYMDEF(RELEASE='520')
logical operator (& |)

A logical operator joins each set of conditions. Use one of these logical operators:

&

Signifies AND logic. Both conditions must be met for the statement to be true.

|

Signifies OR logic. Either condition can be met for the statement to be true.

An example showing AND logic:

SYSPLEX='PLEX01'&SYSNAME='HP92'

In this example, the system that is named HP92 must be found on the PLEX01 sysplex for this condition to be true.

Examples

The following examples show how to specify the IF and ENDIF commands:

IF(SYSPLEX='PLEX01'&SYSNAME='HP92')
  SELECT(JOBPURGE,JOBNUM,EQ,J*)
ENDIF()
IF(SYSPLEX=PLEX01'&SYSNAME='HP94'|SYSNAME='HP97')
  SELECT(STEPTERM,JOBNUM,EQ,J*)
  ENDIF()
IF(SYSPLEX='PLEX01'&SYSNAME='HP97')
  SCREEN(DSCLOSE,ACCESS,EQ,INPUT)
  ENDIF()
IF(SYSNAME='HP91'|SYSNAME='HP92'|SYSNAME='HP94')
  SCREEN(JOBTERM,JOBNAME,EQ,JRDR)
  ENDIF()
IF(SYSNAME='HP91'|SYSNAME='HP92'|SYSNAME='HP94')
  PROTOCOL(TCPIP)
  ENDIF()