Hi Laurie, I love your suggestion (I am not a SAS developer so I am learning). Thank you. I adopted the complete query to my problem and it runs without error BUT is failing to remove the 11/14/2016 Out SYS Files (t1.out_sys_date ne &L_SYS_File.) All source formats are MMDDYY10 yet I have a feeling that somehow, the formats aren't matching and that is why it misses the 11/14/2016. IF I use this format, the query works: WHERE t1.Out_Sys_Date NE '14Nov2016'd AND t1.Last_Stat = '*'; Do you have any idea of what I might be missing? Thank you. Kody_Devl Here is what I have: proc sql noprint; /* Stops the output window triggering */ select L_SYS_File into: L_SYS_File from LOAN_DETAIL_SRCES_F_L; %Put &L_SYS_File.; /* Produces the correct date in the correct date formatted as '11/14/2016' */ CREATE TABLE WORK.Roll_3 AS SELECT 3 as PostNo, t1.Loan_Number, t1.Out_Status_Day AS Day format mmddyy8., t2.SourceDate_dte_NEXT AS Posting_Day format mmddyy8., "3 OUT" as Type, t1.StatusNo as StatNo, t1.Status as Stat, /* cnt */ -(COUNT(t1.Loan_Number)) FORMAT=CHAR10. AS cnt FROM WORK.LOAN_DETAIL_STATUS t1 INNER JOIN WORK.LOAN_DETAIL_SRCES t2 ON (t1.Out_Status_Day = t2.Source_Date_dte) where t1.last_stat = '*' and t1.out_sys_date ne &L_SYS_File. GROUP BY t1.Loan_Number, t1.Out_Status_Day, t2.SourceDate_dte_NEXT, t1.StatusNo, t1.Status; QUIT;
... View more