- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
I have multiple programs (10) in a folder. They are lengthy. Is there a SAS script that can allow me to write string of code to tell SAS to run all Programs within that folder? Thank you. Example: My SAS programs and original table files D:\Data_Trending
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I've merged your posts into one, please do not post the same question multiple times.
You can use %INCLUDE with a wild card to call all programs but they may not run in the order you want.
%include 'D:\Data_Trending\*.sas' / source2 lrecl=500;
SOURCE2 tells SAS to still put the code to the log and LRECL specifies the line length of the input program, the default is 256 I believe which can sometimes truncate your code causing issues.
@BaileyY wrote:
Hi.
I have multiple programs (10) in a folder. They are lengthy. Is there a SAS script that can allow me to write string of code to tell SAS to run all Programs within that folder? Thank you. Example: My SAS programs and original table files D:\Data_Trending
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
I have multiple programs (10) in a folder. They are lengthy. Is there a SAS script that can allow me to write string of code to tell SAS to run all Programs within that folder? Thank you. Example: My SAS programs and original table files D:\Data_Trending
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You already posted this question in the SAS Programming forum, here: https://communities.sas.com/t5/SAS-Programming/Auto-run-SAS-Programs/m-p/599648#M173127 and that is probably a better place for the question than the Procedures forum.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I've merged your posts into one, please do not post the same question multiple times.
You can use %INCLUDE with a wild card to call all programs but they may not run in the order you want.
%include 'D:\Data_Trending\*.sas' / source2 lrecl=500;
SOURCE2 tells SAS to still put the code to the log and LRECL specifies the line length of the input program, the default is 256 I believe which can sometimes truncate your code causing issues.
@BaileyY wrote:
Hi.
I have multiple programs (10) in a folder. They are lengthy. Is there a SAS script that can allow me to write string of code to tell SAS to run all Programs within that folder? Thank you. Example: My SAS programs and original table files D:\Data_Trending
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @BaileyY a quick searched reveals many solution to your question.
here is one possible solution.
%macro run_one (path);
proc printto log="&path.log";
run;
proc printto print="&path.lst";
run;
%include "&path.sas";
run;
%mend run_one;