One of the variables in my source of data is number of 16 characters.
I want this variable to have a numeric format in my dataset.
When I import data into SAS, using EG import wizard, I choose numeric format, but only 12 characters appear with trimming 4 last numbers.
Can anybody explain how to import long numbers in SAS.
I'm with TomKari and Patrick on this one. If you have ever dealt with bank data, account numbers and credit card numbers are typically up to 16 digits long and so are always stored as character to avoid precision issues.
I find all releases of SAS can support 16digit numbers in numeric variables. Unfortunately, the default behaviour of excel is to convert the 16th (on th eright) to zero!
Unsigned packed decimal (format/informat PK.) saves half the storage over strings.
have a look at the saslog after running this code, as tested on AIX
input a : best20. ;
file "&sysuserid/test.hex.data" ;
put a pk8. ;
infile "&sysuserid/test.hex.data" ;
Yes, SOME 16 digit numbers will be represented correctly, but large numbers will fail. In windows, the following code
a = 9234567812345670; put a 16.;
a = 9234567812345671; put a 16.;
a = 9234567812345672; put a 16.;
a = 9234567812345673; put a 16.;
a = 9234567812345674; put a 16.;
a = 9234567812345675; put a 16.;
a = 9234567812345676; put a 16.;
a = 9234567812345677; put a 16.;
a = 9234567812345678; put a 16.;
a = 9234567812345679; put a 16.;