Hi experts,
I want to compare a hash value between some days and obtain a new table(s) with the results, just to known where the data has changed. The Second table has a day plus than the first table to make de evaluation and see if the next day has a different value. i'm not sure if i can do something like this :
%macro sqlloop(start,end);
PROC SQL;
DATE_FROM = '05MAY2019'D;
%DO ADD=&start. %TO &end.;
DATE_PLUS1=intnx('DAY',&DATE_FROM,1);
CREATE TABLE NewTable&ADD. as
SELECT t1.date, t1.account, t1.val_hash FROM table1 t1, table2 t2
WHERE t1.date = "&DATE_FROM"D AND t2.date = "&DATE_PLUS1"D
AND t1.account = t2.account
AND t1.VAL_HASH <> t2.VAL_HASH;
DATE_FROM=intnx('DAY',&DATE_FROM,1);
%END;
QUIT;
%mend;
%sqlloop(start=1, end=10)
table2 is a replicate of table1, just to make the comparisson between dates.
The val_hash column contains the data that i need to evaluate if it has changed.