<?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: How to create a mixed-data-type variable in EG Query? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-mixed-data-type-variable-in-EG-Query/m-p/3062#M972</link>
    <description>Phil,&lt;BR /&gt;
&lt;BR /&gt;
I was trying Put( ) function yesterday but did not use BEST. format.  I just tried the BEST. format and it worked. Thanks a lot.&lt;BR /&gt;
&lt;BR /&gt;
Yimin</description>
    <pubDate>Wed, 16 May 2007 14:32:40 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-05-16T14:32:40Z</dc:date>
    <item>
      <title>How to create a mixed-data-type variable in EG Query?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-mixed-data-type-variable-in-EG-Query/m-p/3060#M970</link>
      <description>I am trying to replicate the following SAS codes using the EG query:&lt;BR /&gt;
&lt;BR /&gt;
If "Var01"n = 0 then "Var02"n = "abcdefg";&lt;BR /&gt;
else "Var02"n = "Var01"n/100;&lt;BR /&gt;
&lt;BR /&gt;
The codes run without any problem in EG.  The EG won't allow the following in the query:&lt;BR /&gt;
&lt;BR /&gt;
Case When Var01=0 then 'abcdef' Else Var01/100 End&lt;BR /&gt;
&lt;BR /&gt;
since "Result of WHEN clause 2 is not the same data type as the preceding results". I tried to convert the numeric value to string but did not success. &lt;BR /&gt;
&lt;BR /&gt;
Any suggestions?</description>
      <pubDate>Wed, 16 May 2007 02:52:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-mixed-data-type-variable-in-EG-Query/m-p/3060#M970</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-05-16T02:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a mixed-data-type variable in EG Query?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-mixed-data-type-variable-in-EG-Query/m-p/3061#M971</link>
      <description>Have you tried converting the numeric result using a PUT() function in the THEN clause?  You may need to change the BEST. format to suit your data values:&lt;BR /&gt;
&lt;BR /&gt;
  Case When "Var01"n=0 then 'abcdef' Else PUT("Var01"n/100, BEST.) End&lt;BR /&gt;
&lt;BR /&gt;
Data step code statements are probably too relaxed, and will auto-convert numeric and character values, as necessary.  SQL statements are not as relaxed, and require character variables to be given character values, and numeric variables to be given numeric values.&lt;BR /&gt;
&lt;BR /&gt;
.......Phil Holland</description>
      <pubDate>Wed, 16 May 2007 12:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-mixed-data-type-variable-in-EG-Query/m-p/3061#M971</guid>
      <dc:creator>prholland</dc:creator>
      <dc:date>2007-05-16T12:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a mixed-data-type variable in EG Query?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-mixed-data-type-variable-in-EG-Query/m-p/3062#M972</link>
      <description>Phil,&lt;BR /&gt;
&lt;BR /&gt;
I was trying Put( ) function yesterday but did not use BEST. format.  I just tried the BEST. format and it worked. Thanks a lot.&lt;BR /&gt;
&lt;BR /&gt;
Yimin</description>
      <pubDate>Wed, 16 May 2007 14:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-mixed-data-type-variable-in-EG-Query/m-p/3062#M972</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-05-16T14:32:40Z</dc:date>
    </item>
  </channel>
</rss>

