The SAS Output Delivery System and reporting techniques

Make directory with 'md'

Reply
Occasional Contributor
Posts: 14

Make directory with 'md'

I am trying to make some directories with spaces at the names. I used 'md' statement. However, it doesn't allow spaces and just give the first word as the directories name. Any suggestion how to do this?
Thanks.
N/A
Posts: 0

Re: Make directory with 'md'

Posted in reply to flyingsohigh
I think this should work...

X 'md "My long directory with lot of spaces\With one sub-directory"';

It seems that the thing is how SAS works with apostrophs and quotation marks.
Jaroslav
Super Contributor
Posts: 345

Re: Make directory with 'md'

Posted in reply to flyingsohigh
The dcreate-function supports directory names with spaces, just put the name of the new directory in quotes.

Example:

[pre]
data _null_;
newDir = dcreate("long directory name", "parent_dir");
run;
[/pre]
Occasional Contributor
Posts: 14

Re: Make directory with 'md'

Posted in reply to andreas_lds
dcreate works great. Since I have macro variables in my statement, the md still cannot work things right. Thanks a lot for your help!
Contributor
Posts: 30

Re: Make directory with 'md'

Posted in reply to flyingsohigh
Gidday

We use macros in our dcreate, &ExtractCopy does have spaces

data _null_;
newdir=dcreate("&PDEyyyy&PDEmm&PDEdd","&ExtractCopy");
run;

Derek
Ask a Question
Discussion stats
  • 4 replies
  • 493 views
  • 0 likes
  • 4 in conversation