Hello
I want to create a folder(Directory) for each car maker (SAShelp.cars data set)
Name of the field in (SAShelp.cars data set is "Make"
What is the way to do it please?
I know to create one NewDirectory.
data _null_;
NewDirectory=dcreate("RRRT1","path");
run;
However, I dont know how to do it for multiple.
Should I use macro?
Can you show the code please?
Read @andreas_lds post again, thoroughly.
You run a data step off your dataset, use by, and execute dcreate at the group change.
Thank you.
I have tried but still I got only one folder called "make" instead of 38 folders...
PROC SQL;
create table bbbb as
select distinct Make as Make
from sashelp.cars
order by Make
;
QUIT;
data _null_;
NewDirectory=dcreate("sashelp.cars","/path/");
run;
Data cccc;
set bbbb;
by Make;
NewDirectory=dcreate("Make","/path/sashelp.cars");
Run;
proc sort data=sashelp.cars out=cars;
by Make;
run;
data _null_;
set cars;
by Make;
if first.Make then do;
NewDirectory=dcreate(Make,"c:\");
end;
run;
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!
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.