The VALUELIST and VALUERANGE attributes limit the set of values that a variable, an argument, or a returned value can have. The VALUELIST attribute specifies a list of values while the VALUERANGE attribute specifies an inclusive range of values.
>>-VALUELIST-(expression -+----------------+-)----------------->< '-,--expression -'
The VALUELIST attribute is valid only with computational and ordinal types.
>>-VALUERANGE-(expression 1,expression 2)----------------------><
The VALUERANGE attribute is valid only with computational and ordinal types. If the computational type is numeric, it must be REAL.
define alias numeric_month fixed bin(7) valuerange(1,12);
dcl imonth type numeric_month;
dcl cmonth char(3)
valuelist( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
The
variable imonth must hold only a value between
1 and 12 inclusive, and the variable cmonth must
hold only one of the 12 specified values.VALIDVALUE( imonth )
BETWEEN( imonth, 1, 12 )
( 1 <= imonth ) & ( imonth <= 12 )
dcl month_due type numeric_month init(0);
cmonth = '';