I don't understand the confusion, Robert. You want to be able to tell when a delivery is strictly less than 37 months, and when it is greater than 37 (inclusive) months. So, based on the data set have that you used in the above reply, you get exactly that when you run this code: proc format; value yesno 1 = "Premature" 0 = "Not premature"; quit; data have2; set have; delivery_premature = (. < labor < 37); format delivery_premature yesno.; run; Please let me know what happens when you run this above code?? when you use delivery_premature = (. < delivery < 37) ....what this translates to is: SAS please put a 1 whenever this condition (. < delivery < 37) is true, and put a 0 otherwise, which should save you from writing the next line (else if delivery >= 37)
... View more