<?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 help in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25979#M5902</link>
    <description>Try doing your join on  something like  &lt;BR /&gt;
where a.var1 = put(b.var1, best.)

Um, well yea, what Daniel said.&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Flip</description>
    <pubDate>Fri, 04 Dec 2009 16:37:38 GMT</pubDate>
    <dc:creator>Flip</dc:creator>
    <dc:date>2009-12-04T16:37:38Z</dc:date>
    <item>
      <title>PROC SQL help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25976#M5899</link>
      <description>Is there a way to change a column's data type from numeric to character or character to numeric in a PROC SQL step ?  I'm trying to do a join of two tables to get some columns from one table that are not in the other.  The column I am doing the join on (customer social security number) is numeric in one table, but character in another.

Message was edited by: chandler</description>
      <pubDate>Fri, 04 Dec 2009 16:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25976#M5899</guid>
      <dc:creator>chandler</dc:creator>
      <dc:date>2009-12-04T16:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25977#M5900</link>
      <description>Explore using either the PUT or INPUT function in your PROC SQL SELECT statement to generate compatible SAS variables.  The SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  has references with code examples.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 04 Dec 2009 16:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25977#M5900</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-04T16:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25978#M5901</link>
      <description>Yes, this is possible.&lt;BR /&gt;
&lt;BR /&gt;
You just have to convert one to the other using the appropriate function.&lt;BR /&gt;
&lt;BR /&gt;
For example, this would work for an inner join:&lt;BR /&gt;
&lt;BR /&gt;
[pre]proc sql noprint;&lt;BR /&gt;
create table result as&lt;BR /&gt;
select a.CUS_SOCIAL_SEC_NUM, a...,&lt;BR /&gt;
          b...&lt;BR /&gt;
from TABLE_A as a, TABLE_B as b&lt;BR /&gt;
where a.CUS_SOCIAL_SEC_NUM = inputn(b.CUS_SOCIAL_SEC_NUM,'best.');&lt;BR /&gt;
quit;[/pre]&lt;BR /&gt;
&lt;BR /&gt;
inputn function converts a alphanumeric value to a numeric one&lt;BR /&gt;
&lt;BR /&gt;
see: &lt;A href="http://support.sas.com/documentation/cdl/en/sclref/59578/HTML/default/a000162302.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/sclref/59578/HTML/default/a000162302.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
or the opposite will do the same:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
...&lt;BR /&gt;
where strip(put(a.CUS_SOCIAL_SEC_NUM,best.)) = strip(b.CUS_SOCIAL_SEC_NUM);[/pre]&lt;BR /&gt;
&lt;BR /&gt;
put function converts a numeric value to a alphanumeric one&lt;BR /&gt;
&lt;BR /&gt;
see: &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000199354.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000199354.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
strip functions just makes sure there is no blanks before and after the value.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Fri, 04 Dec 2009 16:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25978#M5901</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-12-04T16:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25979#M5902</link>
      <description>Try doing your join on  something like  &lt;BR /&gt;
where a.var1 = put(b.var1, best.)

Um, well yea, what Daniel said.&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Flip</description>
      <pubDate>Fri, 04 Dec 2009 16:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25979#M5902</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-12-04T16:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25980#M5903</link>
      <description>So many posts at the same time&lt;BR /&gt;
&lt;BR /&gt;
:D &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
chandler, you've got the answer.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Fri, 04 Dec 2009 16:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help/m-p/25980#M5903</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-12-04T16:38:46Z</dc:date>
    </item>
  </channel>
</rss>

