<?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 Changing a variable from NUM to CHAR in PROC SQL in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-a-variable-from-NUM-to-CHAR-in-PROC-SQL/m-p/138995#M11207</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there, i'm trying to Left Join a variable but the column I'm matching it to are different data types. WHat is the best way to format it?&lt;/P&gt;&lt;P&gt;I tried to format ATSo.odr_number using $&lt;STRONG&gt;13.&amp;nbsp; &lt;/STRONG&gt;but i keep getting errors. Should I use a Proc Format before this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CREATE TABLE work.add_class AS&lt;/P&gt;&lt;P&gt;&amp;nbsp; SELECT ac.date_shipped, ac.order_id, ac.brand_code, ac.customer_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; ATSo.classification, ATSo.brand_code AS ATSbrand&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM work.add_cust AS ac&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEFT JOIN work.TEMP_ORDERS AS ATSo&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ON ac.invoice_number = ATSo.odr_number $13.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Sep 2014 18:11:21 GMT</pubDate>
    <dc:creator>zhou_larry</dc:creator>
    <dc:date>2014-09-10T18:11:21Z</dc:date>
    <item>
      <title>Changing a variable from NUM to CHAR in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-a-variable-from-NUM-to-CHAR-in-PROC-SQL/m-p/138995#M11207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there, i'm trying to Left Join a variable but the column I'm matching it to are different data types. WHat is the best way to format it?&lt;/P&gt;&lt;P&gt;I tried to format ATSo.odr_number using $&lt;STRONG&gt;13.&amp;nbsp; &lt;/STRONG&gt;but i keep getting errors. Should I use a Proc Format before this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CREATE TABLE work.add_class AS&lt;/P&gt;&lt;P&gt;&amp;nbsp; SELECT ac.date_shipped, ac.order_id, ac.brand_code, ac.customer_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; ATSo.classification, ATSo.brand_code AS ATSbrand&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM work.add_cust AS ac&lt;/P&gt;&lt;P&gt;&amp;nbsp; LEFT JOIN work.TEMP_ORDERS AS ATSo&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; ON ac.invoice_number = ATSo.odr_number $13.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;RUN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 18:11:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-a-variable-from-NUM-to-CHAR-in-PROC-SQL/m-p/138995#M11207</guid>
      <dc:creator>zhou_larry</dc:creator>
      <dc:date>2014-09-10T18:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Changing a variable from NUM to CHAR in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-a-variable-from-NUM-to-CHAR-in-PROC-SQL/m-p/138996#M11208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use proc contents to check variable types. if ac.invoice_number is char then try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON input(ac.invoice_number,8.) = ATSo.odr_number ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 18:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-a-variable-from-NUM-to-CHAR-in-PROC-SQL/m-p/138996#M11208</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-09-10T18:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing a variable from NUM to CHAR in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-a-variable-from-NUM-to-CHAR-in-PROC-SQL/m-p/138997#M11209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt; create table work.add_class as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select ac.date_shipped, ac.order_id, ac.brand_code, ac.customer_id,atso.classification, atso.brand_code as atsbrand&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from work.add_cust as ac left join work.temp_orders as atso&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on ac.invoice_number =&lt;STRONG&gt; put(atso.odr_number,char13.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;data have1;&lt;BR /&gt;input id $ var $;&lt;BR /&gt;cards;&lt;BR /&gt;1 a&lt;BR /&gt;2 b&lt;BR /&gt;3 c&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data have2;&lt;BR /&gt;input id var $;&lt;BR /&gt;cards;&lt;BR /&gt;1 a&lt;BR /&gt;2 b&lt;BR /&gt;3 c&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt;select a.* from have1 a left join have2 b on a.id=put(b.id,char1.);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;proc contents data=want;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 18:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-a-variable-from-NUM-to-CHAR-in-PROC-SQL/m-p/138997#M11209</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2014-09-10T18:23:39Z</dc:date>
    </item>
  </channel>
</rss>

