Hi Forum,
I would like SAS EG or SAS Studio to create a sub directory on Windows filesystem as the month previous to the one we are currently in, on the Windows file system however; so for example I would like that here
Q:\\BLAHBLAH\blahblah\5
Gets created on the previously existing
Q:\\BLAHBLAH\blahblah\
From with the UNIX-based SAS which resides I-don't know-where-but-probably-something-like-/opt/sas/... on some server-side which I cannot see. (I have no clue if I can write on that particular Q:\\ win-subdirectory but I tried having SAS output with ODS an excelfile in that path, this works.)
Since we are now in June the to be created sub dir should be '5' - so I created a variable which will return me the 5 like such
/*creates dir*/
%let P_month = %sysfunc(month(%sysfunc(intnx(month, %sysfunc(today()), -1))));
%put The Previous Month (based on one month back) is: &p_month;
run;
This works but;
How can I incorporate it into a statement to get the dir creation done?
DLCREATEDIR is not working/unallowed probably, DCREATE will not return an error but also do nothing (as in I see no win dir getting created and no log error), is it possible its logging is incomplete?
Thanks!
Kind regards,
heleen
If I understood you correctly, you are running SASon server, you are connected to the server by SAS EG, and you want to create a new directory on your local drive?
If this is the setup, then the answer is: you won't be able to do this.
Such a try in real life could be compared to try of putting food into an oven using Zoom/Teams call.
If the SAS Server could create an Excel file and you can see the file on Q: drive, this probably means the drive is a network drive and it is your local windows connecting to it, and for the server, what you can see as "Q:\\BLAHBLAH\blahblah" is probalbly "/..<some/sub/path/here>../BLAHBLAH/blahblah/"
So if you want create sub-dir there you should use, the server path.
Bart
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.