My Friend, I found a solution using loop, Thks Anyway! %macro sqlloop(start,end); PROC SQL; %let DATE_FROM = '05MAY2019'd; %let DATE_PLUS1 = '06MAY2019'd; %DO ADD=&start. %TO &end.; CREATE TABLE compare_&ADD. as SELECT T2.DATE, T2.ACCOUNT, T2.VAL_HASH FROM TABLE1 T1, TABLE2 T2 WHERE T1.ACCOUNT = T2.ACCOUNT AND T1.DATE = "&DATE_FROM"d AND T2.DATE = "&DATE_PLUS1"d AND T1.VAL_HASH <> T2.VAL_HASH; %let DATE_FROM=intnx('DAY',&DATE_FROM,1); %let DATE_PLUS1=intnx('DAY',&DATE_PLUS1,1); %END QUIT; %mend; %sqlloop(start=1, end=5)
... View more