<?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: How can I convert a character value with leading zeros to numeric and maintain the leading zeros? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-a-character-value-with-leading-zeros-to/m-p/13398#M2860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Slightly more involved than I originally posted.&amp;nbsp; You have to use a mixture of put and input functions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x $;&lt;/P&gt;&lt;P&gt;&amp;nbsp; z=put(input(x,9.),z9.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;11&lt;/P&gt;&lt;P&gt;111&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Feb 2012 18:52:08 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-02-24T18:52:08Z</dc:date>
    <item>
      <title>How can I convert a character value with leading zeros to numeric and maintain the leading zeros?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-a-character-value-with-leading-zeros-to/m-p/13397#M2859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a data item (is SSN) that is defined with character format. The ssn does NOT have any dashes, just numbers.&amp;nbsp;&amp;nbsp; I need to convert this to numeric without losing the leading zeros.&amp;nbsp; I do not see any functions that would do this.&amp;nbsp; Any suggestions on how I can accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 18:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-a-character-value-with-leading-zeros-to/m-p/13397#M2859</guid>
      <dc:creator>ncsthbell</dc:creator>
      <dc:date>2012-02-24T18:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I convert a character value with leading zeros to numeric and maintain the leading zeros?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-a-character-value-with-leading-zeros-to/m-p/13398#M2860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Slightly more involved than I originally posted.&amp;nbsp; You have to use a mixture of put and input functions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x $;&lt;/P&gt;&lt;P&gt;&amp;nbsp; z=put(input(x,9.),z9.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;11&lt;/P&gt;&lt;P&gt;111&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 18:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-a-character-value-with-leading-zeros-to/m-p/13398#M2860</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-24T18:52:08Z</dc:date>
    </item>
    <item>
      <title>How can I convert a character value with leading zeros to numeric and maintain the leading zeros?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-a-character-value-with-leading-zeros-to/m-p/13399#M2861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Blogged about this topic just last Friday ... check it out ... &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.bi-notes.com/2012/02/sas-coding-adding-leading-zeros-z-format/"&gt;http://www.bi-notes.com/2012/02/sas-coding-adding-leading-zeros-z-format/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 18:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-a-character-value-with-leading-zeros-to/m-p/13399#M2861</guid>
      <dc:creator>TriciaA</dc:creator>
      <dc:date>2012-02-24T18:58:30Z</dc:date>
    </item>
    <item>
      <title>How can I convert a character value with leading zeros to numeric and maintain the leading zeros?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-a-character-value-with-leading-zeros-to/m-p/13400#M2862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, you can convert the ssn into numeric but define the format as Zw.d. eg:&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt; x='0001451';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data t1;&lt;/P&gt;&lt;P&gt; set test;&lt;/P&gt;&lt;P&gt; format y z7.;&lt;/P&gt;&lt;P&gt; y=x*1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 18:34:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-can-I-convert-a-character-value-with-leading-zeros-to/m-p/13400#M2862</guid>
      <dc:creator>CarlW</dc:creator>
      <dc:date>2012-03-02T18:34:48Z</dc:date>
    </item>
  </channel>
</rss>

