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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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