Is there any way to export sas SQL to tSQL ?
Thanks
SAS SQL is constructed between a PROC SQL statement and a closing semicolon, possibly followed by a QUIT statement.
proc sql;
create table table1 as
select *
from ............;
quit;
If you simply copy the bolded SQL into your tSQL editor it will in some cases work unmodified. You may have to tweak it to get it to work but for simple queries that shouldn't be a lot of work.
If you wish to do this a lot and repeatedly then you should use SAS's SQL Pass-through. In that case the SQL being used would be identical to tSQL.
As you might have guesse from :s answer, the direct answer for your question is no, not any SAS Institute supported one at least.
Since SAS SQL programs are plain text files, there is nothing stopping anyone to write some kind of parser program to re-program to t-SQL - but I never heard of any such tool. In fact, this is what SAS/ACCESS to OLEDB/ODBC does behind the curtain - reprogram to native DBMS engine SQL. But I don't think that you can fetch this code on the fly, at least not from SAS.
But, why do you ask, what is your underlying requirement?
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.