RANGE_CHECK: PROC(VALUE,RANGE) RETURNS(BIT(1)); /* PROCEDURE CHECKS FOR VALUE IN RANGE AND RETURNS LOGICAL VALUE */ DCL VALUE FIXED BINARY(31); DCL RANGE CHAR(*) VARYING; DCL TMP_RANGE CHAR(LENGTH(RANGE)) VARYING BASED(P); DCL P POINTER; DCL RANGE_ELEMENT CHAR(20) VARYING; DCL T CHAR(1); DCL (I,J,HIGH,LOW) FIXED BINARY(31); ALLOCATE TMP_RANGE SET(P); ON ERROR BEGIN; PUT EDIT('Range incorrectly specified--',RANGE) (SKIP,2 A); PUT SKIP; STOP; END; TMP_RANGE=RANGE; DO WHILE(TMP_RANGE^=''); RANGE_ELEMENT=LOP(TMP_RANGE,','); IF INDEX(RANGE_ELEMENT,'-')=0 THEN DO; LOW=FIXED(RANGE_ELEMENT,31); HIGH=LOW; END; ELSE DO; LOW=FIXED(LOP(RANGE_ELEMENT,'-'),31); HIGH=FIXED(RANGE_ELEMENT,31); END; IF LOW<=VALUE & VALUE<=HIGH THEN RETURN('1'B); END; RETURN('0'B); END RANGE_CHECK;