<?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: Leading zeros in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669809#M23231</link>
    <description>&lt;P&gt;I may depend on how the column "variable" is defined in excel. If it is configured to be text, proc import reads it as text retaining the leading zeros.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Forgot to mention: it is really time to post the code you have used to read the file.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jul 2020 05:38:37 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-07-16T05:38:37Z</dc:date>
    <item>
      <title>Leading zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669555#M23210</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need some help with important an excel document where some observations have leading zeros and some do not. For example, take the following sample dataset:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Variable&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;002&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;617&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;012&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;G317&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I import this into sas while keeping the leading zeros?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669555#M23210</guid>
      <dc:creator>marleeakerson</dc:creator>
      <dc:date>2020-07-15T16:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669562#M23211</link>
      <description>&lt;P&gt;Are you using PROC IMPORT? It guesses, and sometimes it guesses wrong, and thus you can't specifically control the import and have it always behave the way you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can convert the Excel file to .csv, then you can read it in using custom data step code, and force this column to be character and then the leading zeros will be retained.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669562#M23211</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-15T16:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669563#M23212</link>
      <description>&lt;P&gt;Have you tried reading the data already? If you have values like G317 as shown I would expect Proc Import to read the column as text. You may want to use the SCANTEXT option to make sure the length set holds all the values. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or how did you expect to read the file?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669563#M23212</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-15T16:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669809#M23231</link>
      <description>&lt;P&gt;I may depend on how the column "variable" is defined in excel. If it is configured to be text, proc import reads it as text retaining the leading zeros.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Forgot to mention: it is really time to post the code you have used to read the file.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 05:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669809#M23231</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-07-16T05:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669838#M23236</link>
      <description>&lt;P&gt;Please attach an example of this Excel file to your next post.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 09:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669838#M23236</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-16T09:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Leading zeros</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669986#M23240</link>
      <description>&lt;P&gt;If you are really using PROC IMPORT to read from an XLSX (or even an XLS) file then SAS will NOT remove the leading zeros.&amp;nbsp; If they are gone then that was caused in Excel.&amp;nbsp; Most likely the cells with the missing leading zeros have mistakenly been created a numeric values in the Excel sheet instead of the strings that they actually are.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 20:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Leading-zeros/m-p/669986#M23240</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-16T20:58:11Z</dc:date>
    </item>
  </channel>
</rss>

