My problem is the following.
I have to make a dashboard using a table generated by another team. the tables are named as table_YYYYMM — However, the data is not always on sync, so i have to use the most recent available.
so i’d like to try to code something like:
proc sql; create table want as select t1.*, t2.column1, t2.column2 from have t1 left join **[table_202405] OR [table_202404] OR [table_202403] (whatever is most recent)** t2 on (t1.key = t2.key); run;
is there a way to do that?
i thouth of checking if the table exists before running the code, or perhaps some kind of max(yyyymm). but i have no idea how to code this.
Leandro Ortolan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.