<?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: Proc SQL to match on part of a text string in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-to-match-on-part-of-a-text-string/m-p/71335#M20589</link>
    <description>have a look at the (sql-only) comparison operators  &lt;BR /&gt;
EQT  &lt;BR /&gt;
LET&lt;BR /&gt;
GET&lt;BR /&gt;
NET&lt;BR /&gt;
etc.&lt;BR /&gt;
&lt;BR /&gt;
that trailing"T" implies "truncated to shorter"&lt;BR /&gt;
&lt;BR /&gt;
PeterC

Message was edited by: Peter_c</description>
    <pubDate>Tue, 27 Jan 2009 12:08:38 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-01-27T12:08:38Z</dc:date>
    <item>
      <title>Proc SQL to match on part of a text string</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-to-match-on-part-of-a-text-string/m-p/71333#M20587</link>
      <description>Forgive me if this is easy to do but I am new to SAS.&lt;BR /&gt;
&lt;BR /&gt;
I am trying to do a proc sql and use a text string as the match key. The only problem is that the string changes between 4 or 2 digits and I need to either do a match to the 4 digit if it exists or to match to the 2 digit if the 4 is not available. &lt;BR /&gt;
&lt;BR /&gt;
For example in table 1 I have:&lt;BR /&gt;
&lt;BR /&gt;
ABCD&lt;BR /&gt;
ABDH&lt;BR /&gt;
EFGH&lt;BR /&gt;
GHIJ&lt;BR /&gt;
&lt;BR /&gt;
In table 2 I have:&lt;BR /&gt;
&lt;BR /&gt;
AB&lt;BR /&gt;
ABCD&lt;BR /&gt;
EF&lt;BR /&gt;
GHIJ&lt;BR /&gt;
&lt;BR /&gt;
I would want it to match as:&lt;BR /&gt;
&lt;BR /&gt;
ABCD -&amp;gt; ABCD&lt;BR /&gt;
ABDH-&amp;gt; AB&lt;BR /&gt;
EFGH-&amp;gt; EF&lt;BR /&gt;
GHIJ-&amp;gt; GHIJ&lt;BR /&gt;
&lt;BR /&gt;
I hope that makes sense?</description>
      <pubDate>Mon, 26 Jan 2009 23:17:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-to-match-on-part-of-a-text-string/m-p/71333#M20587</guid>
      <dc:creator>myrad</dc:creator>
      <dc:date>2009-01-26T23:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL to match on part of a text string</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-to-match-on-part-of-a-text-string/m-p/71334#M20588</link>
      <description>Not really. Your "AB" in table 2 will match both "ABCD" and "ABDH" in table 1, unless you specify some other specification to your matching rule. Nevertheless, your join criteria would look something like this:&lt;BR /&gt;
&lt;BR /&gt;
where table1.id eq table2.id or substr(table1.id,1,2) eq table2.id &lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Tue, 27 Jan 2009 09:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-to-match-on-part-of-a-text-string/m-p/71334#M20588</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-01-27T09:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL to match on part of a text string</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-to-match-on-part-of-a-text-string/m-p/71335#M20589</link>
      <description>have a look at the (sql-only) comparison operators  &lt;BR /&gt;
EQT  &lt;BR /&gt;
LET&lt;BR /&gt;
GET&lt;BR /&gt;
NET&lt;BR /&gt;
etc.&lt;BR /&gt;
&lt;BR /&gt;
that trailing"T" implies "truncated to shorter"&lt;BR /&gt;
&lt;BR /&gt;
PeterC

Message was edited by: Peter_c</description>
      <pubDate>Tue, 27 Jan 2009 12:08:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-to-match-on-part-of-a-text-string/m-p/71335#M20589</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-01-27T12:08:38Z</dc:date>
    </item>
  </channel>
</rss>

