<?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: Remove leading zeros function? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710224#M218595</link>
    <description>&lt;P&gt;You cannot match numbers to characters.&amp;nbsp; It will be easier to convert the strings into numbers since there is no difference between 0010 and 10 as numbers.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
  select *
   from one inner join two
   on input(one.common,32.) = two.cv
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 Jan 2021 17:14:49 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-01-08T17:14:49Z</dc:date>
    <item>
      <title>Remove leading zeros function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710220#M218593</link>
      <description>&lt;P&gt;I have two datasets I want to merge, keeping only the rows found in dataset 2; they have a common variable, weight in grams, but those variables aren't named or formatted (num/char) the same.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dataset 1 has: Common&amp;nbsp; &amp;nbsp;CHAR&amp;nbsp; &amp;nbsp;$3&lt;/P&gt;
&lt;P&gt;Dataset 2 has: CV&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NUM&amp;nbsp; &amp;nbsp; &amp;nbsp; 4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something else I realized when looking at the variables sorted side by side, is that DS1 has an irregular number of leading zeros, depending on which observation it is, so I need a &lt;STRONG&gt;way to remove them&lt;/STRONG&gt; so they can match.&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Dataset&lt;/TD&gt;
&lt;TD width="25%" height="28px"&gt;DS1&lt;/TD&gt;
&lt;TD width="50%" height="28px"&gt;
&lt;P&gt;&lt;STRONG&gt;DS2 -- &amp;gt; what I want to match to&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Lowest weight (grams)&lt;/TD&gt;
&lt;TD width="25%" height="28px"&gt;0010&lt;/TD&gt;
&lt;TD width="50%" height="28px"&gt;10&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;Highest weight (grams)&lt;/TD&gt;
&lt;TD width="25%" height="28px"&gt;0865&lt;/TD&gt;
&lt;TD width="50%" height="28px"&gt;865&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 08 Jan 2021 17:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710220#M218593</guid>
      <dc:creator>SAS93</dc:creator>
      <dc:date>2021-01-08T17:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Remove leading zeros function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710224#M218595</link>
      <description>&lt;P&gt;You cannot match numbers to characters.&amp;nbsp; It will be easier to convert the strings into numbers since there is no difference between 0010 and 10 as numbers.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
  select *
   from one inner join two
   on input(one.common,32.) = two.cv
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jan 2021 17:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710224#M218595</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-08T17:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Remove leading zeros function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710225#M218596</link>
      <description>&lt;P&gt;You cannot have 4 digits in your dataset 1, as the variable is defined with a length of 3. Please review your question, and make sure that you get all types and attributes correct.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 17:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710225#M218596</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-01-08T17:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Remove leading zeros function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710239#M218600</link>
      <description>&lt;P&gt;Because the strings posted included periods I assumed the information posted was the FORMATs attached to the variables and not the LENGTH of the variables.&amp;nbsp; There is no need to include a period when specifying the LENGTH of a variable since a length can only be an integer.&amp;nbsp; The format attached to a character variable does not modify the LENGTH of the values stored in the variable.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 17:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710239#M218600</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-08T17:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Remove leading zeros function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710399#M218679</link>
      <description>&lt;P&gt;Thank you! That was a solution that was right under my nose, I just didn't see it..&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2021 19:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-leading-zeros-function/m-p/710399#M218679</guid>
      <dc:creator>SAS93</dc:creator>
      <dc:date>2021-01-09T19:54:20Z</dc:date>
    </item>
  </channel>
</rss>

