Help using Base SAS procedures

Create a new format

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

Create a new format

Hi,

I have tables with character columns for SSNs. I will like to build a format to have those numbers look like actual SSNs with the dashes, but still be a chracter column, not numeric.

SSNs_as_I_have_themSSNs_as_I_want_them
001234567001-23-4567
123456789123-45-6789
999999999999-99-9999

I have never build a format before.  Any help?

Thanks! Smiley Happy


Accepted Solutions
Solution
‎07-15-2015 04:24 PM
Super User
Posts: 11,343

Re: Create a new format

Posted in reply to ismahero2

Use the SAS supplied format in a data step after temporarily treating SSN as numeric.

SSN_as_wanted = put(input(ssn,best.), ssn11.);

View solution in original post


All Replies
Solution
‎07-15-2015 04:24 PM
Super User
Posts: 11,343

Re: Create a new format

Posted in reply to ismahero2

Use the SAS supplied format in a data step after temporarily treating SSN as numeric.

SSN_as_wanted = put(input(ssn,best.), ssn11.);

🔒 This topic is solved and locked.

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

Discussion stats
  • 1 reply
  • 210 views
  • 0 likes
  • 2 in conversation