Hello ,
I am try to exceute the sas programs in a dircroty by %inc statement.
Requirement : 1) In a dirctory sas program will be genrated based on user input (we don't know number of proagrams and praograsm name )
2) Once user genrated sas programs , then exceute those progrms one by one in sas pogram file.
3) once the all prograsm exceuted then exit the current program.
Thank you,
Rajasekhar Reddy
Without knowing the names and the order in which the programs have to be executed, your task can't be solved.
Don't do this in SAS, use a shell script:
for PROGRAM in ${PROGPATH}/*.sas do sas $PROGRAM done
Add additional options (autoexec, config, log, output location) to the SAS call.
Running unknown programs in a single SAS instance is dangerous, as one program might change settings (options, libnames, file references, macro variables) and cause unwanted effects in the following codes.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.