I have some complex sql code to run from SAS, currently its working in SQL server but not from SAS. I tried simple SELECT SQL to execute from PROC sql with Execute odbc. its not giving any error and warning and no output
do you suggest what could be the problem
Proc SQL;
connect to odbc(DSN=&DSN user=&user password=&pwds);
Execute (DECLARE @Query NVARCHAR(MAX) = ''
Set @Query='select distinct qrm_db from [FASTControl].[dbo].ALM_NVPData
PRINT @Query
sp_executesql @Query
') by odbc;
quit;
NOTE: Writing HTML(EGHTML) Body file: EGHTML
23 FILENAME EGXLSSX TEMP;
24 ODS EXCEL(ID=EGXLSSX) FILE=EGXLSSX STYLE=Excel
25 OPTIONS (
26 EMBEDDED_TITLES="no" EMBEDDED_FOOTNOTES="no"
27 );
28
29 GOPTIONS ACCESSIBLE;
30 Proc SQL;
31 connect to odbc(DSN=&DSN user=&user password=&pwds);
32 Execute (DECLARE @Query NVARCHAR(MAX) = ''
33 Set @Query='select distinct qrm_db from [FASTControl].[dbo].ALM_NVPData
34 PRINT @Query
35 sp_executesql @Query
36 ') by odbc;
37 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.12 seconds
cpu time 0.05 seconds