<?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 Variable conversion in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378535#M24619</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to convert variables (MP_LASTNAME and MP_FIRSTNAME) to character variables in these statements? How would I go about this? I get an error that these variables are numeric and wasnt sure how besides using a put statements would do this for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from outlib.MCP_QUAL as a&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left join refdata.xwalk_careone_crm as b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on UPCASE(COMPRESS(strip(a.PtFirst))) = UPCASE(COMPRESS(strip(b.MP_FIRSTNAME)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and UPCASE(COMPRESS(strip(a.PtLast))) = UPCASE(COMPRESS(strip(b.MP_LASTNAME)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rida&lt;/P&gt;</description>
    <pubDate>Sun, 23 Jul 2017 15:36:32 GMT</pubDate>
    <dc:creator>Rsadiq</dc:creator>
    <dc:date>2017-07-23T15:36:32Z</dc:date>
    <item>
      <title>Variable conversion</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378535#M24619</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to convert variables (MP_LASTNAME and MP_FIRSTNAME) to character variables in these statements? How would I go about this? I get an error that these variables are numeric and wasnt sure how besides using a put statements would do this for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from outlib.MCP_QUAL as a&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left join refdata.xwalk_careone_crm as b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on UPCASE(COMPRESS(strip(a.PtFirst))) = UPCASE(COMPRESS(strip(b.MP_FIRSTNAME)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and UPCASE(COMPRESS(strip(a.PtLast))) = UPCASE(COMPRESS(strip(b.MP_LASTNAME)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rida&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 15:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378535#M24619</guid>
      <dc:creator>Rsadiq</dc:creator>
      <dc:date>2017-07-23T15:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Variable conversion</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378538#M24621</link>
      <description>You would need to use the format and put function to convert the MP_FIRSTNAME and MP_LASTNAME to character. an example would be as below &lt;BR /&gt;UPCASE(COMPRESS(strip(a.PtFirst))) = UPCASE(COMPRESS(strip(put(b.MP_FIRSTNAME,fmt.))))&lt;BR /&gt;and UPCASE(COMPRESS(strip(a.PtLast))) = UPCASE(COMPRESS(strip(put(b.MP_LASTNAME,fmt.))))&lt;BR /&gt;</description>
      <pubDate>Sun, 23 Jul 2017 15:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378538#M24621</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-07-23T15:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variable conversion</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378539#M24622</link>
      <description>&lt;P&gt;Why can't you do this without conversion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;on a.PtFirst = b.MP_FIRSTNAME&lt;/P&gt;
&lt;P&gt;and a.PtLast = b.MP_LASTNAME;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you certain that the variables were created properly in the first place? &amp;nbsp;It seems unusual for variables holding first and last name to be numeric.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 15:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378539#M24622</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-07-23T15:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Variable conversion</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378541#M24623</link>
      <description>&lt;P&gt;I am trying this but its not working still giving me an error (put(a.PtFirst,format $15.))))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MPRINT(STEP2):&amp;nbsp;&amp;nbsp; create table ALL_NPART as select distinct a.* ,b.MP_FIRSTNAME as _Fname format $15. ,b.MP_LASTNAME as _Lname&lt;BR /&gt;format $15. ,b.indv_id ,b.MP_MANAGEDPERSONID ,b.MP_BIRTHDATE as _DOB ,b.MP_zip as _zip from outlib.MCP_QUAL as a left join&lt;BR /&gt;refdata.xwalk_careone_crm as b on UPCASE(COMPRESS(strip(put(a.PtFirst,format $15.)))) = UPCASE(COMPRESS(strip(b.MP_FIRSTNAME))) and&lt;BR /&gt;UPCASE(COMPRESS(strip(put(a.PtLast,format $15.)))) = UPCASE(COMPRESS(strip(b.MP_LASTNAME))) ;&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a format name, ?.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 16:27:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378541#M24623</guid>
      <dc:creator>Rsadiq1</dc:creator>
      <dc:date>2017-07-23T16:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Variable conversion</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378546#M24624</link>
      <description>&lt;P&gt;You're close. You don't use the word "format" when using a format. Also, if you're converting a numeric variable to character, don't start the format name with a "$".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example of what you're trying to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; TestTable &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; put(a.Age, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;15.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; CharAge&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sashelp.class &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 18:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Variable-conversion/m-p/378546#M24624</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-07-23T18:02:24Z</dc:date>
    </item>
  </channel>
</rss>

