Hi,
Does SAS support any way to execute an external SQL script?
I have a dozen scripts, with 100's of statements that would require me to wrap each statement with EXECUTE( ) BY TERA to use with pass-through facility. I'm open to suggestions for ways I can use SAS to execute the scripts.
You could build the code as text, then run it
filename terasql temp;
data _null_;
length sqlStatement $2000;
infile ...;
input...;
/* Build SQL code here into */
file terasql;
put sqlStatement;
run;
proc sql;
connect to ...;
%include terasql;
quit;
Why not just ask the operating system to use BTEQ to run the script for you?
You can use the PIPE engine or one of the many commands that SAS has for running operating system commands.
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.