<?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 to leftpad zeroes in SAS in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-leftpad-zeroes-in-SAS/m-p/762520#M39365</link>
    <description>&lt;P&gt;If the table you are working with is not a "passthru" to an external database (such as Oracle or similar), then use format z10.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Aug 2021 13:07:02 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-08-19T13:07:02Z</dc:date>
    <item>
      <title>how to leftpad zeroes in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-leftpad-zeroes-in-SAS/m-p/762517#M39364</link>
      <description>&lt;P&gt;I have an update statement for a table. Since LPAD does not work in SAS. is there a way to easily pad the zeros?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;update &amp;lt;TABLE&amp;gt;&lt;BR /&gt;set UNIQUE_KEY = Compress('BI'||&lt;STRONG&gt;lpad('9161',7,'0')&lt;/STRONG&gt;||'MTSMBE'||(put(CREATION_DATE_TIME,10.)));&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 13:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-leftpad-zeroes-in-SAS/m-p/762517#M39364</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2021-08-19T13:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to leftpad zeroes in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-leftpad-zeroes-in-SAS/m-p/762520#M39365</link>
      <description>&lt;P&gt;If the table you are working with is not a "passthru" to an external database (such as Oracle or similar), then use format z10.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 13:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-leftpad-zeroes-in-SAS/m-p/762520#M39365</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-19T13:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to leftpad zeroes in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-leftpad-zeroes-in-SAS/m-p/762527#M39369</link>
      <description>&lt;P&gt;Are you trying to generate a digit string from a number?&amp;nbsp; If so just use PUT() function and Z format.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put(9161,Z7.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will generate the string '0009161'.&lt;/P&gt;
&lt;P&gt;If your source is already a string (and cannot be converted to an integer using INPUT()) then you will need to work harder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many answers to that question on this forum, although I suspect none of them are using the terminology of "LPAD()" whatever language you got that from.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 13:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-leftpad-zeroes-in-SAS/m-p/762527#M39369</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-19T13:20:04Z</dc:date>
    </item>
  </channel>
</rss>

