Perhaps thinking about this wrong, what I would do is this:
%macro Create_Folder (d=);
/* From d derive monyyyy var */
data _null_;
temp=input("&d.",ddmmyy8.);
temp2=substr(put(temp,date9.),3);
call symputx('mmmyyyy',temp2);
run;
/* Create folder */
x 'mkdir "c:/data_location/Test_&mmmyyyy./&d."';
/* Write out text file to directory */
data _null_;
file "c:/data_location/Test_&mmmyyyy./&d./batch_ini_file.txt";
put "#####################################";
...
put "directory=/data_location/Test_&mmmyyyy./&d./";
put "filename="Test_28022019";
run;
%mend Create_Folder;
/* Call macro for each month of year (note you can't do by day as you don't have day in filename */
data _null_;
do i=1 to 12;
call execute('%Create_Folder (d=2018',put(i,z2.),'01);');
end;
run;
This will create a folder with the text file inside for each month of the year.
I would highly advise against using MMMYYYY format for anything (its not granular enough, and its a bad representation of date as language changes can mean different spellings, it doesn't sort etc.) Use Iso dates, they are much better.
Also, I would question why you would need to do this, sound like a big process for something which doesn't sound like it adds any value to me? I would hope most people nowadays use version control software of some kind, so this dated files/folders thing should be long gone, let the software manage that for you.
... View more