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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

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
  • 864 views
  • 0 likes
  • 2 in conversation