Personal tools
You are here: Home Software Packages SAS How to display a large number in Proc Freq?

How to display a large number in Proc Freq?

— filed under: ,

Force exponential representation to display all digits

I'm trying to create a variable that's 13 digits long (and another one that's 21 digits long), but when I do PROC FREQ it would display the values as, for example, "1.01101E13"


Is there a way to make it so that it could display all 13 or however many digits?


The key is to use a FORMAT:


data one;
format x best26. y best32.;
x = 1234567890123456789;
y = 1234567890123456789012345;
run;
proc print;
run;

You may want to reconsider what you are doing. If you are trying to create an ID variable, it would probably be best to make it a character variable. On Unix systems, the largest number than can be represented exactly is:

9,007,199,254,740,992

which is 16 digits. The variable that would be 21 characters will have some type of truncation, which could have bad results - depending on what you are doing.

Document Actions

Copyright ©2008, The Pennsylvania State University | Privacy and Legal Statements
Contact the Help Site Administrator | Last modified Aug 13, 2008 | Weblion Partner