guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi there,
Condition var:Wherever a condition can occur, such as in an IF statement or an EVALUATE or a PERFORM..UNTIL, a Condition Name (Level 88) may be used.
Condition Names are defined in the DATA DIVISION using the special level number 88. They are always associated with a data-item and are defined immediately after the definition of the data-item.
A Condition Name is a name given to a specified subset of the values which its associated data-item can hold.
Like a condition, a Condition Name evaluates to True or False.
eg:01 EUCountryCode PIC 99.
88 CodeIs1 VALUE 1.
88 CodeIs2 VALUE 2.
88 CodeIs3 VALUE 3.
etc.
IF CodeIs2 THEN
ADD Bonus to StructuralFunds(EUCountry)
END-IF
IF CodeIs1 THEN
SUBTRACT Bonus FROM StructuralFunds(EUCountry)
END-IF
SETVerb:SET {ConditionName} ... TO TRUE
A Condition Name set to true when one of the condition values mentioned in its VALUE clause is moved into its associated data-item. But you can also set a Condition Name to true using the SET verb.
When the SET verb is used to set a Condition Name, the first condition value specified after the VALUE clause in the definition is moved to the associated data-item. Thus, the value of the associated data-item is changed.
Regarding ur 3 question yes we can set it to true befor using condition variable
Hope it will helpful |
|