BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
dr2014
Quartz | Level 8


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

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
Haikuo
Onyx | Level 15

X100?

dr2014
Quartz | Level 8

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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