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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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