Hi. I need to create a flag variable (r30) based on a time interval (TimeToClm) variable. Basically, r30 is defined such that r30=1 if 0<TimeToClm<=30 – a left open and right closed interval. The TimeToClm is a float variable with numbers ranging from 0 to 95. The code below is recording r30=1 even when TimeToClm=0 or TimeToClm>30 and I'm not sure why. I'd appreciate any guidance here.


Code:
genr30=.
replace r30=1 if 0<TimeToClm<=30