Same results. I found an explanation of why it's happening: https://support.sas.com/resources/papers/proceedings/proceedings/sugi26/p073-26.pdf *********************************************************** In SAS, character strings must be adjusted to the same length before they can be compared. When SAS compares character strings without the colon modifier, it pads the shorter string with blanks to the length of the longer string before making the comparison. When SAS compares character strings with the colon modifier after the operator, it truncates the longer string to the length of the shorter string. This feature of the colon modifier makes the comparison of a character string's prefix possible. For example, if zip='010' then do; * This will pick up any zip which equals '010' exactly; if zip=:'010' then do; * will pick up any zip starting with '010', such as '01025','0103', '01098'; if zip>=:'010' then do; * will pick up any zip from '010' up alphabetically, such as '012', '21088'; where lastname gt: ‘Sm’; * will pick up any last name alphabetically higher than ‘Sm’, such as ‘Smith’,‘SNASH’, ‘Snash’; The colon modifier can follow all comparison operators (=:, >=:, <=:, ne:, gt:, lt:, in:) to conduct prefix comparison. The following 'in:' operation will select the students located in zip codes which begin with '010', '011', '0131', '0138', respectively: data s; set student; if zip in:('010','011','0131','0138'); ************************************** Seems like where "&dx_start." <= diag <= "&dx_end." ; should work, but it doesn't.
... View more