BookmarkSubscribeRSS Feed
Walternate
Obsidian | Level 7

Hi,

 

I need to create a lot of subfolders in a directory. They will always be the final folder in a branch of the directory and always have the same name, eg:

 

Folder1/Folder2/test

Folder1/Folder3/test

Folder1/Folder4/Folder5/test

 

I was thinking there must be a way to automate this in SAS. I would know how to set it up by hand or even providing the beginning of the path and just automating the addition of test, but I was thinking there is probably a way that I can do it using just the umbrella folder (Folder1) and let SAS figure out the rest. Am I correct in thinking this? What is the best way to set this up so it's as automated as possible?

 

 

1 REPLY 1
Reeza
Super User

Have you seen this post?

It doesn't do the nested loops but I'm 99% certain there's code for that on here already. 

 

https://blogs.sas.com/content/sasdummy/2013/07/02/use-dlcreatedir-to-create-folders/

 


@Walternate wrote:

Hi,

 

I need to create a lot of subfolders in a directory. They will always be the final folder in a branch of the directory and always have the same name, eg:

 

Folder1/Folder2/test

Folder1/Folder3/test

Folder1/Folder4/Folder5/test

 

I was thinking there must be a way to automate this in SAS. I would know how to set it up by hand or even providing the beginning of the path and just automating the addition of test, but I was thinking there is probably a way that I can do it using just the umbrella folder (Folder1) and let SAS figure out the rest. Am I correct in thinking this? What is the best way to set this up so it's as automated as possible?

 

 


 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 289 views
  • 0 likes
  • 2 in conversation