I am pulling data from Azure Databricks using JDBC when I get an error as below. It seems to be a transcoding issue. My SAS session is running on LATIN1 encoding. I am using below command to run my programs right now. Any idea how to invoke SAS in UTF-8 mode from command line in Unix.
ERROR: Data from column 'Var1' in row 273138 of the result set was not presented in UTF-8 format. The length of this data is 17
bytes, and the first 7 characters are 'Castili'. Adding -JREOPTIONS (-Dfile.encoding=UTF-8) to the SAS invocation may
circumvent the issue. Otherwise the data should be corrected to UTF-8 format.
NOTE: The DATA step has been abnormally terminated.
NOTE: The SAS System stopped processing this step because of errors.
SAS Unix command:
/opt/sas/sharebi/config/Lev1/Applications/SASGridManagerClientUtility/9.4/sasgsub -gridsubmitpgm data_pull.sas -gridwork /data/team_abc/log -gridwaitnoresults
Did you try the suggestion from the log to add -JREOPTIONS to the invocation?
/opt/sas/sharebi/config/Lev1/Applications/SASGridManagerClientUtility/9.4/sasgsub -gridsubmitpgm data_pull.sas -gridwork /data/team_abc/log -gridwaitnoresults -JREOPTIONS (-Dfile.encoding=UTF-8)
The error message is weird. SAS is saying the data isn't UTF-8. Generally if SAS recognized the data as being UTF-8, it would at least try to transcode it for you, and you might get some transcoding warnings but it would "work". You might want to work with SAS tech support on this. You could try adding -encoding UTF-8 to your invocation.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.