<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert Charater number to Numeric number with dash in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-Charater-number-to-Numeric-number-with-dash/m-p/673860#M202793</link>
    <description>&lt;P&gt;Why not use the &lt;A href="https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=n1sroiq0fqlgncn1d52g0go5xqeq.htm&amp;amp;docsetVersion=1.0&amp;amp;locale=en" target="_self"&gt;SSN format&lt;/A&gt;?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have ;
  ssno11 = put(ssno,ssn11.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 01 Aug 2020 02:05:15 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-08-01T02:05:15Z</dc:date>
    <item>
      <title>Convert Charater number to Numeric number with dash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Charater-number-to-Numeric-number-with-dash/m-p/673855#M202790</link>
      <description>&lt;P&gt;Hi Expert,&lt;/P&gt;&lt;P&gt;I would like to convert character number to numeric number with dash variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input id $ Character $11. ;&lt;BR /&gt;datalines;&lt;BR /&gt;1 123-45-7890&lt;BR /&gt;2 234-65-3960&lt;BR /&gt;3 351-47-9012&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following code, but the numeric variable was still character.&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;Numeric=input(Character, $11.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more question, I want to know how to conver character from or to numeric number if the variable include dash (-).&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 01:32:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Charater-number-to-Numeric-number-with-dash/m-p/673855#M202790</guid>
      <dc:creator>lulu3</dc:creator>
      <dc:date>2020-08-01T01:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Charater number to Numeric number with dash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Charater-number-to-Numeric-number-with-dash/m-p/673858#M202791</link>
      <description>&lt;P&gt;Those look like Social Security numbers.&amp;nbsp; Leave them as character. You will not have any reason to take the mean of a SSNO. Or add two or more of them together so there is no reason to store them as numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To remove the dashes use COMPRESS() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  length id $8 ssno11 $11 ssno $9 ;
  input id ssno11  ;
  ssno = compress(ssno11,'-');
datalines;
1 123-45-7890
2 234-65-3960
3 351-47-9012
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Aug 2020 01:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Charater-number-to-Numeric-number-with-dash/m-p/673858#M202791</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-08-01T01:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Charater number to Numeric number with dash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Charater-number-to-Numeric-number-with-dash/m-p/673859#M202792</link>
      <description>&lt;P&gt;Yes, it is SSN. I have one dateset the SSN was original stored as numeric number (etc. 123-45-6789). I want to transfer the numeric SSN to character SSN. Do you have any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Aug 2020 02:00:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Charater-number-to-Numeric-number-with-dash/m-p/673859#M202792</guid>
      <dc:creator>lulu3</dc:creator>
      <dc:date>2020-08-01T02:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Charater number to Numeric number with dash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Charater-number-to-Numeric-number-with-dash/m-p/673860#M202793</link>
      <description>&lt;P&gt;Why not use the &lt;A href="https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=n1sroiq0fqlgncn1d52g0go5xqeq.htm&amp;amp;docsetVersion=1.0&amp;amp;locale=en" target="_self"&gt;SSN format&lt;/A&gt;?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have ;
  ssno11 = put(ssno,ssn11.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 01 Aug 2020 02:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Charater-number-to-Numeric-number-with-dash/m-p/673860#M202793</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-08-01T02:05:15Z</dc:date>
    </item>
  </channel>
</rss>

