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

My name is Mason. I am a new admin for SAS, We just setup a SAS 9.4 on Linux server, we use unixODBC to connect to DB, the version 2.3.1 comes with RHEL7 didn’t work at all, so we downloaded and built unixODBC 2.3.7 on this server and modify LD_LIBARAY_PATH so sasodb will see it Eathan’s than the old 2.3.1, now we are able to connect to the ODBC data source which is a DB2 on AS/400. However when we started to run query, it won’t work at all. It prompted “token invalid”, but the SQL statement we entered was very simple and proved to be running well through query tool.

ERROR: CLI prepare error: [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0104 - Token was not valid. Valid tokens: ( CL END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN. : [IBM][System i Access ODBC Driver][DB2 for i5/OS]PWS0005 - Error
occurred in the database host server code.
SQL statement: SELECT * FROM TEST.QSRVSRC.

I checked with IBM support and we turned on ODBC trace to see what was fed to ODBC, it is strange that ODBC got a different meaningless string as SQL statement, which is for sure won’t be able to go through. Below is in ODBC trace log

ODBC][18654][1596812654.551234][SQLPrepareW.c][165]
Entry:
Statement = 0x7fea00000e60
SQL = [SLC RMUI00.N_PCNTSQFRRA NY][length = 54]
[ODBC][18654][1596812654.571800][SQLPrepareW.c][346]
Exit:[SQL_ERROR]
DIAG [42000] [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0104 - Token was not valid. Valid tokens: ( CL END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN.
DIAG [HY000] [IBM][System i Access ODBC Driver][DB2 for i5/OS]PWS0005 - Error occurred in the database host server code.

The SAS on PC(MS Windows) are working with the same DB (also through ODBC) without any problem.

Is there anything that can be configured wrong to cause this kind of issue? Any help is highly appreciated.
1 ACCEPTED SOLUTION

Accepted Solutions
masonluo
Fluorite | Level 6

finally it seems to be encoding compatibility problem, the installation points !SASROOT/sas to bin/sas_u8, when we use bin/sas_en instead then there is no problem at all. 

View solution in original post

4 REPLIES 4
SASKiwi
PROC Star

You would be best to open a track with SAS Tech Support if you haven't already as your setup isn't common.

masonluo
Fluorite | Level 6
Thanks SASKiwi. We did open a case to SAS tech support. Just wan to see if there is anyone has similar experience....
SASKiwi
PROC Star

Great. Unfortunately ODBC setup on Unix is way different than on Windows and always seems to be harder to troubleshoot.

masonluo
Fluorite | Level 6

finally it seems to be encoding compatibility problem, the installation points !SASROOT/sas to bin/sas_u8, when we use bin/sas_en instead then there is no problem at all. 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1723 views
  • 2 likes
  • 2 in conversation