At this stage, I know, BETWEEN-AND can only be used in WHERE statements. After Your indication of SQL, I have just investigated the subject further. There is a chapter Understanding SAS Indexes in SAS 9.4 Language Reference: Concepts, Sixth Edition. It provides detailed explanation about indexing of data by SAS. It can be possible that specific operators i.e. BETWEEN-AND, CONTAINS, IS MISSING or IS NULL, LIKE, SAME-AND, and Sounds-Like are only allowed in the WHERE statement, so the User is somehow forced to use them at the stage of filtering the input before the data is delivered into the PDV (Program Data Vector) for further processing in a cursor-like fashion (in a loop). In case of operators which are applied to strings (text): CONTAINS, LIKE, Sound-Like the performance gain is quite obvious. But in case of BETWEEN-AND it is not so obvious. For instance: is it always better to use (x BETWEEN a AND b) over (a<=x<=b) expressions in the WHERE statements? Maybe I will learn something more in the future.
... View more