Hello,
So I have a code that contains a macro for a date to always choose the current month. However the code uses a file that gets updated quarterly so that means unless I change the date manually it wont find the latest date file. I think a do loop macro can help? Any ideas?
Thank you!
%macro wrapper;
%if &pdefadjrun=1 %then %do;
%if %sysfunc(exist( file_name_&ReportDateYMD. ))^=1
%then %do;
%put NOTE: file_name_&ReportDateYMD. dataset does not exist;
%end;
%else %if %sysfunc(exist(file_name_&ReportDateYMD. ))=1
%then %do;
I have to say that I am not sure I understand what you are asking.
Please describe the problem from scratch. Don't discuss code or macros, just describe what you are trying to do in words.
@Hiandbye wrote:
Thanks! I may have not explained this well. The macro in the code sets the current date but the above code uses a file that updates every quarter. So for example if I want to run this for today I will have to change the &ReportDateYMD to the latest available date file. Is there a way where SAS can find and use the latest available file no matter the current date macro?
Thanks!
Steps:
All of this can be done in SAS data steps. No macros needed.
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.