06-22-2014 05:46 PM
SAS SQL is constructed between a PROC SQL statement and a closing semicolon, possibly followed by a QUIT statement.
create table table1 as
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.
06-23-2014 05:09 AM
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?