Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.1.6.3 Condition-Name Condition



A condition-name condition tests a conditional variable to determine whether its value is equal to any value(s) associated with the condition-name.


    ___ Format _____________________________________________________________ 
   |                                                                        |
   | >>__condition-name__________________________________________________>< |
   |                                                                        |
   |________________________________________________________________________|
A condition-name is used in conditions as an abbreviation for the relation condition. The rules for comparing a conditional variable with a condition-name value are the same as those specified for relation conditions.

If the condition-name has been associated with a range of values (or with several ranges of values), the conditional variable is tested to determine whether or not its value falls within the range(s), including the end values. The result of the test is true if one of the values corresponding to the condition-name equals the value of its associated conditional variable.


X Condition-names with DBCS and floating-point values are allowed.

The following example illustrates the use of conditional variables and condition-names:


     01  AGE-GROUP            PIC  99.
         88  INFANT           VALUE 0.
         88  BABY             VALUE 1, 2.
         88  CHILD            VALUE 3 THRU 12.
         88  TEEN-AGER        VALUE 13 THRU 19.

AGE-GROUP is the conditional variable; INFANT, BABY, CHILD, and TEEN-AGER are condition-names. For individual records in the file, only one of the values specified in the condition-name entries can be present.

The following IF statements can be added to the above example to determine the age group of a specific record:


     IF INFANT...             (Tests for value 0)
     IF BABY...               (Tests for values 1, 2)
     IF CHILD...              (Tests for values 3 through 12)
     IF TEEN-AGER...          (Tests for values 13 through 19)

Depending on the evaluation of the condition-name condition, alternative paths of execution are taken by the object program.

Subtopics:



Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.