BookmarkSubscribeRSS Feed
flyingsohigh
Calcite | Level 5
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.
4 REPLIES 4
deleted_user
Not applicable
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
andreas_lds
Jade | Level 19
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]
flyingsohigh
Calcite | Level 5
dcreate works great. Since I have macro variables in my statement, the md still cannot work things right. Thanks a lot for your help!
DerekAdams
Calcite | Level 5
Gidday

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

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

Derek

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2466 views
  • 0 likes
  • 4 in conversation