The COMPARE macro compares two values. You can:
Parameters: COMPARE Macro
Is a mandatory field that is used to specify the variable that contains the value you want to compare. You can use the Start of Compare and the Length fields to compare a substring of the value.
Is a mandatory field that specifies the relational operator to use for the comparison. The value must be one of the following:
Is used to specify a variable that contains the value you want to use as the basis of the comparison.
Is used when you want to specify a fixed text string as the basis of the comparison.
Note: To use a null value for comparison, leave both the Variable Name 2 field and the Constant Value field blank.
Indicates the start position of the string in variable 1 from which the comparison takes place. The value of this field must be a number from 1 through 255.
Indicates how much of the string in variable 1 is to be compared. The value, if specified, must be a number from 1 through 255. If a value is not specified, the full string or substring, starting from the specified start position, is compared.
Return Codes: COMPARE Macro
Comparison criteria satisfied
Comparison criteria not satisfied
Example: COMPARE Macro
In the following example, the COMPARE macro checks whether the value of the &A3 variable is greater than the value of the &A2 variable.
PROD----- Automation Services : COMPARE MACRO Parameter Definition ------------ Command ===> Function=BROWSE .- COMPARE Parameters --------------------------------------------------------. | | | Syntax .......... (Variable 1) OPERATOR (Variable 2)> or (Constant) | | | | | | Variable Name 1 ....... A3 (Enter a valid variable name) | | | | Operator .............. GT (EQ,NE,GT,GE,LT,LE,CT) | | | | Variable Name 2 ....... A2 (Enter a valid variable name) | | | | or Constant Value ... | | | | Start of Compare ...... 1 (Start position within variable 1) | | | | Length ................ (Enter length of comparison) | | | ’-----------------------------------------------------------------------------’ F1=Help F2=Split F3=Exit F9=Swap
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |