I'm testing out using a simple piece of code to create directories that don't exist for my monthly SAS analysis so I don't have to manually do the pre-prep so to speak:
options dlcreatedir;
libname newdir "C:\Folder\&YYYYMM.\Inputs";
However I've read that using that options command essentially leaves it on for all subsequent pieces of code and I am worried that it might perform some messy writes on my disk if I make a mistake and leave it on.
Is there a way to turn it off once I am done creating directories?
If you review the documentation you'll notice it lists two options, DLCREATEDIR and NODLCREATEDIR. Use the second to turn off the option.
option nodlcreatedir;
Another option is to use the DCREATE() function without changing the default options to create a folder explicitly rather than rely on the libname statement to create the folder.
data _null_;
folder = dcreate("Inputs", "C:\Folder\&YYYYMM.\");
run;
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002986745.htm