Вопрос

I am trying to import numbers from csv file to sas dataset with proc import ( SAS ) , but all my leading zero are disappear after the import.

For example,

'0123456' after import I would get only '123456'

Это было полезно?

Решение

If you are reading them in as numerical fields, you just need to apply a format to the variable to display the leading zeroes. Remember, the number 012345 is equivalent to the number 12345 so there's no reason to store the leading zero. Try the format

z7.
. To display the zero in your example above. If you really need the zeroes for some reason, and the number of digits is arbitrary, then you need to read them in as character variables instead.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top