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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1582 views
  • 0 likes
  • 4 in conversation