Help using Base SAS procedures

add trailing zeros

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 124
Accepted Solution

add trailing zeros


Hi ,

I have to prepare a SAS dataset. I have a census tract field. The final  field has to contain 11 digits and should be a character variable. At present, its a numeric variable of default  length 8 and best12. format. Some of the numbers are 11 digits and some are 9 digits. Initially , the 11 digit numbers had a 2 digit decimal point (i.e. 123456756.76) . I took of the decimal points using compress function as per requirements of the program. Maybe I should not have done that initially. Now, I need to  add 2 trailing zeros to only those values with 9 digits. Is there something I need to do about leading or trailing blanks too.Please advise.

Thanks.

e.g:

Initial file : numeric data , length 8 and best12. format.

   478901347

167528936.67

567893456.78

    786539269

I need:

47890134700

16752893667

56789345678

78653926900


Accepted Solutions
Solution
‎10-29-2014 04:45 PM
Respected Advisor
Posts: 3,156

Re: add trailing zeros


All Replies
Solution
‎10-29-2014 04:45 PM
Respected Advisor
Posts: 3,156

Re: add trailing zeros

X100?

Frequent Contributor
Posts: 124

Re: add trailing zeros

duh clearly I was overthinking this and then just convert it to character . I took care of the character issue first and then was looking to add the zeroes.

Thanks very much.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 2586 views
  • 1 like
  • 2 in conversation