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;
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
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.
Ready to level-up your skills? Choose your own adventure.