Hi, I tried Tom's code. It works great! I was able to create a sub_directory "test" under the newly created "01 -jan 2012 "folder. data _null_; rootdir='c:\temp\'; today=today(); lastmonth=intnx('month',today,-1); dir1=catx(' ',put(month(lastmonth),z2.),'-',put(lastmonth,monname3.),year(lastmonth)); dir2=catx(' ',put(month(today),z2.),'-',put(today,monname3.),year(today)); dir3='test'; /* Iadded */ newdir1=dcreate(dir1,rootdir); newdir3=dcreate(dir3,newdir1); /* i added*/ newdir2=dcreate(dir2,rootdir); put (rootdir dir1 newdir1 dir2 newdir2 dir3 newdir3) (=/); run; from log file: rootdir=c:\temp\ dir1=01 - Jan 2012 newdir1=c:\temp\01 - Jan 2012 dir2=02 - Feb 2012 newdir2=c:\temp\02 - Feb 2012 dir3=test newdir3=c:\temp\01 - Jan 2012\test NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.01 seconds Message was edited by: Linlin
... View more