BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jim_toby
Quartz | Level 8

I want to query through a table stored on the Netezza server and generate a SAS table out of it.

 

Here is my query:

proc sql; 
connect to odbc as odbcCon 
(noprompt='Driver={NetezzaSQL}; server=xxxxxx; port=xxxxx; database=xxx; username=xxxx; password=xxxxx;'); 
select * from connection to odbcCon 
(SELECT *
  FROM SCHEMA.table1
 LIMIT 100;); 
quit;

It's an sql pass through. How can I generate a SAS table from the result of the query? Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
kiranv_
Rhodochrosite | Level 12

All you need to do is add a create table statement

proc sql; 
connect to odbc as odbcCon 
(noprompt='Driver={NetezzaSQL}; server=xxxxxx; port=xxxxx; database=xxx; username=xxxx; password=xxxxx;'); 
create table work.sastable as 
select * from connection to odbcCon 
(SELECT *
  FROM SCHEMA.table1
 LIMIT 100;); 
quit;

View solution in original post

1 REPLY 1
kiranv_
Rhodochrosite | Level 12

All you need to do is add a create table statement

proc sql; 
connect to odbc as odbcCon 
(noprompt='Driver={NetezzaSQL}; server=xxxxxx; port=xxxxx; database=xxx; username=xxxx; password=xxxxx;'); 
create table work.sastable as 
select * from connection to odbcCon 
(SELECT *
  FROM SCHEMA.table1
 LIMIT 100;); 
quit;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 844 views
  • 0 likes
  • 2 in conversation