<?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 check length in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/check-length/m-p/840217#M332238</link>
    <description>&lt;P&gt;Hello ,&lt;/P&gt;
&lt;P&gt;i have a column (caracter) i want to do like this :&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;data x;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;set x;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;if length code &amp;lt; 5 then;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;concat (code, 0);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;the idea is to add 0 to column code when its length is inferior to 5, do you have suggestions how to do that ?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;thank you&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2022 09:16:31 GMT</pubDate>
    <dc:creator>aloou</dc:creator>
    <dc:date>2022-10-24T09:16:31Z</dc:date>
    <item>
      <title>check length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/check-length/m-p/840217#M332238</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;
&lt;P&gt;i have a column (caracter) i want to do like this :&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;data x;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;set x;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;if length code &amp;lt; 5 then;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;concat (code, 0);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;the idea is to add 0 to column code when its length is inferior to 5, do you have suggestions how to do that ?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;thank you&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 09:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/check-length/m-p/840217#M332238</guid>
      <dc:creator>aloou</dc:creator>
      <dc:date>2022-10-24T09:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: check length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/check-length/m-p/840228#M332240</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input code $;
datalines;
a       
ab      
abc     
abcd    
abcde   
abcdef  
abcdefg 
;

data want;
   set have;
   if length(code) &amp;lt; 5 then code = cats('0', code);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2022 10:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/check-length/m-p/840228#M332240</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-24T10:07:12Z</dc:date>
    </item>
  </channel>
</rss>

