hello,
i use the odbc engine to retrieve data from a snowflake table. it contains a variable x of integers which seem to lose precision in sas. for example:
y = put(x, best32. -l);
i think that this is related to this question:
https://stackoverflow.com/questions/10933725/long-digit-reading-in-sas
as i do not use proc import, this does not help me much, though.
is it possible to convert a numeric snowflake variable into a sas character variable without losing precision?
Snowflake SQL contains functions to do column type conversions: https://docs.snowflake.com/en/sql-reference/functions-conversion.html
Just add the required conversion from numeric to character (VARCHAR) in a SAS passthru SQL query and then SAS will read the character version without any precision loss.
SAS precision for large numbers means that you will need to do the conversion before bringing it into SAS. Possibly export the data from the other data source and then read the data with a data step as character.
Snowflake SQL contains functions to do column type conversions: https://docs.snowflake.com/en/sql-reference/functions-conversion.html
Just add the required conversion from numeric to character (VARCHAR) in a SAS passthru SQL query and then SAS will read the character version without any precision loss.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: