BookmarkSubscribeRSS Feed
Koti
Fluorite | Level 6

Getting below error message while creating table in hadoop via proc sql execute statement.Is there any server options or setting do i need to set to work with execute statement? Note:This code working with out execute statment.

 

ERROR: Connection is missing required option SERVER.

 

Code:

 

proc   sql;
connect to hadoop as sashdp(server=servername port=10000 schema=schemaname subprotocol=hive2);
execute(create table test08_sas row format delimited fields terminated by '\001'
                 stored as textfile as select * from connection to sashdp ( select *,date_sub('2016-08-31',99) as date_sub_value,
case when col1>="2016-01-23 then "2016-08-30"
else "2016-07-31" end as new_col1
from  table1

 

limit 10
))by hadoop;
quit;

2 REPLIES 2
DanielSantos
Barite | Level 11

Hmmm.

 

Is there really a server/schema named servername/schemaname in your system?

 

Because that's what you are providing for your connection

 

connect to hadoop as sashdp(server=servername port=10000 schema=schemaname subprotocol=hive2);

 

Daniel Santos @ www.cgd.pt

DavidGhan
SAS Employee

The issue here is that you are trying to embed a SAS pass-through query within a SAS EXECUTE pass-through. Instead complete the Pass-through EXECUTE statement by putting the Hive select clause directly in the HiVE CREATE TABLE statement. Like so:

 

proc sql;

connect to hadoop as sashdp(server=servername port=10000 schema=schemaname subprotocol=hive2);

execute(create table test08_sas row format delimited fields terminated by '\001'

stored as textfile as select *,date_sub('2016-08-31',99) as date_sub_value,

case when col1>="2016-01-23 then "2016-08-30"

else "2016-07-31" end as new_col1

from table1

 

limit 10

)by hadoop;

quit;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1632 views
  • 0 likes
  • 3 in conversation