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

Hi guys,

 

Does anyone know how we can connect to hive and hadoop environment using SAS pc?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
soham_sas
Quartz | Level 8

You can Create a library using the ODBC , or you can directly access the table also by connect to odbc option 

libname syntax will be like below 

 

libname name odbc dsn = " " schema=" ";

 

ODBC connection syntax will be like below 

 

proc sql inobs=10;
CONNECT TO ODBC (noprompt= " enter your DSN ; schema= ;");
create table dsn as
select * from connection to odbc
(
SELECT varnames
from table name );
quit;

 

NOTE : accessing the data through ODBC connection is more faster than a Libname 

View solution in original post

3 REPLIES 3
soham_sas
Quartz | Level 8

You can Create a library using the ODBC , or you can directly access the table also by connect to odbc option 

libname syntax will be like below 

 

libname name odbc dsn = " " schema=" ";

 

ODBC connection syntax will be like below 

 

proc sql inobs=10;
CONNECT TO ODBC (noprompt= " enter your DSN ; schema= ;");
create table dsn as
select * from connection to odbc
(
SELECT varnames
from table name );
quit;

 

NOTE : accessing the data through ODBC connection is more faster than a Libname 

parmis
Fluorite | Level 6

what would be the dsn and schema?

I already run my query in hive and I have the result. I'm trying to bring it to SAS

 

Thanks

soham_sas
Quartz | Level 8

DSN is your hadoop/hive server name , and schema is your folder name inside the hadoop/hive 

 

for better clarification , it will be a good option to check with your hadoop/hive admin they will tell you exactly what will be the DSN and Schema for the table which you want to access 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2355 views
  • 1 like
  • 2 in conversation