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
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
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
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
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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.