BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Daniela_P
Obsidian | Level 7

Dear experts,

 

I'd like to run all the programs (110) in a directory on my pc with a single instruction.

How could I do it with %include, or some other code?

The programs have different names and are very long. I'd like not to write them all in the enhanced editor, neither to write all their names...

 

Many thanks to all.

Daniela

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
filename x 'c:\temp\*.sas';
%include x/source2;

View solution in original post

6 REPLIES 6
Astounding
PROC Star

Do they have to run in a certain order, or will any order be sufficient?

Daniela_P
Obsidian | Level 7

...any order is good

ballardw
Super User

%include is likely to be your best bet.

 

And you shouldn't have to type anything as any file manager worth it's name should let you copy and paste path and/or file names.

 

An exercise for the interested reader is to use a FILENAME that consistis of and operating system command to pipe the name of the files using something like DIR c:\path\*.SAS to a data step and then use Call Execute to do the include. NOTE: DO not save the resulting program in the same folder as future runs could create multiple references (or use logic to explicitly NOT use that file for the %include).

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Its rarely as simple as pulling in a directory listing and including each file.  What about interdependancies?  How to QC?  Where to send outputs?  How to check inputs etc.

Ksharp
Super User
filename x 'c:\temp\*.sas';
%include x/source2;
Daniela_P
Obsidian | Level 7

Thank you very much,

it worked!

Daniela

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
  • 6 replies
  • 4635 views
  • 2 likes
  • 5 in conversation