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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.