Previous Topic: EVENT(event_name,option)

Next Topic: LABEL(option)

IF(condition & condition ...)

Controls CAIENF command processing based on system variables. If the condition is true, then 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 encountered will be deciphered as the end of the IF statement.

Options are:

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.

= Equal

¬= Not Equal

!= Not Equal

<= Less Than or Equal

>= Greater Than or Equal

> Greater Than

< Less Than.

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 the following table.

SYSPLEX

The 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 either member COUPLExx or LOADxx in SYS1.PARMLIB.

SYSNAME

The 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 either the IEASYMxx or IEASYSxx sysname operand.

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

SYSCLONE

An 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

The 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

The 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

The 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: See the IBM INIT and Tuning Reference for instructions on how to define these symbolics.

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

The following is 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.

The following is an example showing AND logic:

SYSPLEX='PLEX01'&SYSNAME='HP92'

In this example, the system 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()