Appreciate if some of you help me understand what the following where clause will do?
WHERE '31Jan2017'd between t1.PREMIUM_BEG_DT AND t1.PREMIUM_END_DT
This is basic SQL knowledge, perhaps have a read of the SQL in SAS help documents, or help documents on SQL:
Basically, it will select all rows where the begin-date is before or on the 31st of January 2017, and the end date is on that date or after. If you are doing standard SQL, that is (in SAS, that happens if you write Pass-through SQL calls, or if the where clause is passed directly to an external DBMS).
But, if you are doing SAS SQL, it can also be the opposite, if the begin date is larger than the end date. Including if the end date is missing, and the begin date is after the date in question. SAS has a problem with missing values in where clauses, and with the between condition.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.