开发者

SAS proc import missing leading zero

开发者 https://www.devze.com 2023-04-13 07:37 出处:网络
I am trying to import numbers from csv file to sas dataset with proc import ( SAS ) , but all my leading ze开发者_运维百科ro are disappear after the import.

I am trying to import numbers from csv file to sas dataset with proc import ( SAS ) , but all my leading ze开发者_运维百科ro 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号