My starting point is the following:
The data _null_ works as expected, but the filename line gives an error, if the folder does not exist.
How can I wrap it in an %if %then statement? How can I check for the existence of the folder?
filename myfolder FILESRVC FOLDERPATH= "/Reporting/DEV/REG/ABCD/out_json_backup";
data _null_;
dir_id=exist("myfolder");
if dnum(dir_id)=0 then do;
/* do what is necessary if folder is empty */
%put 'hello';
end;
rc=dclose(dir_id);
run;
Please check the docs!
Please check the docs!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.