08-09-2017 03:43 PM
I am new to sas and I am stumped with one of my numeric variables.
So, I have a variable name 'sampleid' which is 14 digits long- no space or dots or commas. When I imported my csv file to sas the sampleid of 020613020202021 looks like this: 2.02E+12. Can anyone help with that?
08-09-2017 03:51 PM
Proc Import in addition to guessing variable types defaults to a "best" format for non-date or time variables.
You can get more digits displayed by assigning a format with more allowed digits such as best14. or F14.
Note that your variable is being treated as numeric so your leading zeroes would require a Z14. format to show them.
You can change the format a number of ways. Best is at reading.
format sampleid z14.;
is inefficient but simple. Proc datasets can modify formats of variables in place. Or the point-and-click on the table column header should allow setting the format.
08-09-2017 08:59 PM
If it is really an ID then you probably will want to read it as character instead of reading it as a number. 14 digits is close to the maximum integer that SAS can store uniquely in a numeric variable.
23 data _null_; 24 x=constant('exactint'); 25 put x= comma24. ; 26 run; x=9,007,199,254,740,992