The question is unclear. Like this?
proc sql;
insert into WORK.TEMP (LAST_DATE_OF_MONTH,DATE,STATUS)
select distinct DT.last_of_month format=date9.
,DWT.date format=date9.
,"&&TABLE_NAME&I" as TABLE
,(DATE is not NULL) as STATUS
from DATES DT
left join WORK.&&TABLE_NAME&I as DWT
on DT.last_of_month = DWT.date;
... View more