Hi All,
I want to create a folder ('07 - 2018 JUL' which is dynamic based on the previous month) and a sub folder ('Personal') at the same time under the location 'C:\Temp\2018 - 2019'. I figured out the folder part, but don't know how to create a sub folder. Can any one help please. Thanks.
My ultimate folder hierarchy will be 'C:\Temp\2018 - 2019\07 - 2018 JUL\Personal'
DATA _NULL_;
rootdir='C:\Temp\2018 - 2019';
today=today();
lastmonth=intnx('month',today,-1);
dir1=catx(' ',put(month(lastmonth),z2.),'-',year(lastmonth),UPCASE(put(lastmonth,monname3.)));
newdir1=dcreate(dir1,rootdir);
RUN;
Call DCREATE again with the PERSONAL name?
Function dcreate() creates all parent directories when you create the bottom one.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.