문제

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