user27008
user27008

Reputation: 610

Converting character variabls to numeric in SAS

I am creating a numeric version of a character variable in SAS. I am using the best32. numeric format along with an input statement, as I do not want to lose any data.

Below is an example that in which SAS is dropping data and I am unclear as to why.

   DATA trial;
X='1264263.336532';
Y=INPUT(X,BEST32.);
PUT Y;
RUN;

Y is only 1264263.3365 and not X. I am unsure why this is happening.

Upvotes: 2

Views: 5675

Answers (1)

Longfish
Longfish

Reputation: 7602

SAS is displaying the number in the default BEST12. format. Try PUT Y best32.; instead

Upvotes: 4

Related Questions