DATA Step, Macro, Functions and more

Convert character to numeric to remove leading zeros

Reply
New Contributor
Posts: 2

Convert character to numeric to remove leading zeros

[ Edited ]

Hi

 

How do I convert data values like 0012345678 which are in char format to 12345678, numeric format using proc sql?

Super User
Posts: 17,963

Re: Convert character to numeric to remove leading zeros

Use the INPUT function. 

New Contributor
Posts: 2

Re: Convert character to numeric to remove leading zeros

[ Edited ]

Does it work in proc SQL?

Super User
Super User
Posts: 7,432

Re: Convert character to numeric to remove leading zeros

Yes.  In proc sql you can use SAS functions as normal.  Converting to number via input will automatically drop leading zeroes.

Super Contributor
Posts: 305

Re: Convert character to numeric to remove leading zeros

Ask a Question
Discussion stats
  • 4 replies
  • 278 views
  • 0 likes
  • 4 in conversation