On SAS 9.3, I'm trying to read in a dataset from a Hadoop database into my work library. The code I'm using is this:
proc sql;
connect to hadoop(subprotocol=hive2 server='&servername' port=10000 schema=&schema_name);
create table work.my_data as
select * from connection to hadoop (
select *
from &table_name
where valuation_date = '2008-01-01'
);
quit;
I get an error (see below) indicating that some of the values are not in Hadoop UTF-8 format and that therefore, the data cannot be read in as a SAS data set:
ERROR: Data from column 'make' in row 707 of the result set was not presented in Hadoop UTF-8 format. The length of this data is 21
bytes, and the first 7 characters are 'RENAULT'. Adding -JREOPTIONS (-Dfile.encoding=UTF-8) to the SAS invocation may
circumvent the issue. Otherwise the data should be corrected to UTF-8 format.
I tried searching for how to add -JREOPTIONS to the code, but was unable to find anything useful. Can anyone advise on the error and how to correct it?
Thank you.
Dhrumil Patel
You can't add it to the code, you assign at SAS invocation:
You can't add it to the code, you assign at SAS invocation:
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.