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.
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!
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.