The IF command lets you assign new values to identifiers or create new identifiers based on existing identifiers.
This command has the following syntax:
IF idoption1=(identifier[,identifier,identifier...]) THEN idoption2=newvalue [ELSE idoption3=newvalue]
Specifies the ID option whose value is being tested.
Specifies an ID option or one or more identifiers to compare to idoption1.
Specifies the ID option whose identifiers are assigned a new value when the IF clause is true. This value can be the same as idoption1.
Defines the new value to assign to the identifier. Replace newvalue with either an ID option or a character string. If you specify a character string, enclose it in single quotes.
Specifies the ID option whose identifiers are assigned a new value when the IF clause is false. This value can be the same as idoption2.
Examples: IF Command
The following command replaces the value of TERMID with the value of TRANID whenever the value of TERMID is equal to L*:
IF TERMID=(L*) THEN TERMID=TRANID
The following command replaces the value of TRANID with the character string production whenever the value of TRANID begins with P:
IF TRANID=(P*) THEN TRANID='production' ELSE TRANID='test'
The following command creates the ID option DEPARTMENT. Whenever the value of TRANID begins with P, DEPARTMENT is assigned the value production.
IF TRANID=(P*) THEN DEPARTMENT='production'
|
Copyright © 2013 CA.
All rights reserved.
|
|