Hello everyone,
I want to send an email if a file is in a directory or not on the 10th day of the month.
I have a macro (rc) that is equal to 1 if the file exists, or equal to 0 if the file doesn't exist.
I have a problem when the file doesn't exist and if we are the 10th day of the month.
I did a test with today's date.
Here is my code :
%let _date=%sysfunc(today(),DDMMYY10.); /* equals to 09/01/2020 in my case */
%let my=%sysfunc(today(),MMYYS.); /* equals to 01/2020 in my case */
%Macro date_success(rc=);
%if &rc.=0 and &_date.=09/&my. %then %do; /*Here we have normally rc=0 AND _date = 09/&my. = 09/01/2020*/
%put "====== SUCCESS =============";
%end;
%else %do;
%put "=========== FAILED =========";
%put "10/&my.";
%end;
%mend;
%date_success(rc=1) /*Return FAILED as normally planed*/
%date_success(rc=0) /*Doesn't return success, it seems that &_date.=09/&my. doesnt work */
Thank you in advance for your help !
Best regards,