<?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: CASE expression not working in Extract Transformation in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192901#M4056</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Try this.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;CASE&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN sourcecolumn = 'Y' then&amp;nbsp; 'Yes'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ELSE sourcecolumn&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;END as &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;targetcolumn&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2014 14:02:45 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2014-12-03T14:02:45Z</dc:date>
    <item>
      <title>CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192900#M4055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know I've used CASE in the past, but for some reason in my current job I'm unable to use a CASE statement as an expression in an Extract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression is as simple as:&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN sourcecolumn = 'Y' then targetcolumn = 'Yes'&lt;/P&gt;&lt;P&gt;ELSE sourcecolumn&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried many variations, but none validate. It seems there is a syntax error at the very beginning. When I look at the validation log, it appears as if the code actually says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE CASE&lt;/P&gt;&lt;P&gt;WHEN...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where does that WHERE come from? I think it is causing the error. (I have nothing in the WHERE tab of the Extract Transformation)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I recall in the expression field of the target column in the MAPPINGS tab, if I were to right click a CASE option would be available. A co-worker also sees this option. I don't&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something off in my job settings preventing the use of a CASE statement in an Extract? How do I get rid of the WHERE? Any other solutions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 13:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192900#M4055</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2014-12-03T13:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192901#M4056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Try this.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;CASE&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN sourcecolumn = 'Y' then&amp;nbsp; 'Yes'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ELSE sourcecolumn&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;END as &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;targetcolumn&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 14:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192901#M4056</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-12-03T14:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192902#M4057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still getting the error.&lt;/P&gt;&lt;P&gt;Here's the CASE statement in the Expression:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="c1.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/8177_c1.PNG" /&gt;&lt;/P&gt;&lt;P&gt;Here's the error:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="c2.PNG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/8178_c2.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Still, any idea why CASE isn't an option in the expression field?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="c3.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/8179_c3.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 14:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192902#M4057</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2014-12-03T14:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192903#M4058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Just a small modification in END as statement. Hopefully, this can provide the desired results.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;CASE&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN group = 'Y' then&amp;nbsp; 'Yes'&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ELSE group&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;END as group&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 14:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192903#M4058</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-12-03T14:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192904#M4059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Made the modification to the CASE statement:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="c4.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/8180_c4.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still getting the error:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="c5.PNG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/8181_c5.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like I mentioned, I wonder if it has anything with that WHERE syntax being inserted on line 9. Could it be causing the issue, and where is it coming from?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 14:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192904#M4059</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2014-12-03T14:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192905#M4060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I see correctly from your print screen you are trying to use CASE expression in a where clause. Try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select *, CASE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN sex = 'M' then&amp;nbsp; 'Male'&lt;/P&gt;&lt;P&gt;ELSE sex&lt;/P&gt;&lt;P&gt;END as newsex&lt;/P&gt;&lt;P&gt; from sashelp.class&lt;/P&gt;&lt;P&gt;having newsex='Male' ;&lt;/P&gt;&lt;P&gt; quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 14:28:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192905#M4060</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-12-03T14:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192906#M4061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I'm not trying to use CASE within a WHERE clause. How is this WHERE clause getting generated? Is it by default?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 14:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192906#M4061</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2014-12-03T14:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192907#M4062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok, I tried that proc sql statement:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="c6.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/8182_c6.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appeared to validate, but when I opened the validation log...still an error:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="c7.PNG" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/8183_c7.PNG" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 14:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192907#M4062</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2014-12-03T14:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192908#M4063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now this is just a guess, but where are you posting that sql code.&amp;nbsp; I assume from the Data Management section that you are using some kind of graphical interface tool, I would assume that you are trying to put into what equates to a Where Condition window.&amp;nbsp; So the "where" is the default text, which then takes the text you put in Expression column to try to evaluate rows, so in Loko's example, the case statement has been moved from the conditional part, up to the selection part.&amp;nbsp; You would need to put the case in another column on your table, not the Expression one.&lt;/P&gt;&lt;P&gt;Sorry, can't be more specific, I avoid all types of graphical interface for these kind's of reason - faster and simpler to write code!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 15:03:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192908#M4063</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-12-03T15:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192909#M4064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ha! Great point...I forgot to mention that this is in Data Integration Studio. It is an interface tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 15:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192909#M4064</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2014-12-03T15:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192910#M4065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a flaw in DI Studio, when validating an expression, it often (not always) puts the expression in a where clause, even if the expression is in a select clause.&lt;/P&gt;&lt;P&gt;In those cases, just ignore the error. You are better off validating by running the transformation instead - if your syntax is valid, it will succeed.&lt;/P&gt;&lt;P&gt;Tip: DI Studio will default output to a view. Temporarily switch to a table - that will reveal any error at once (instead of when reading the view from succeeding transformations).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 15:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192910#M4065</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-12-03T15:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: CASE expression not working in Extract Transformation</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192911#M4066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LinusH, thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just found this out...I ignored the validation error, executed the job, and the Extract ran fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Odd, but good to know!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 16:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/CASE-expression-not-working-in-Extract-Transformation/m-p/192911#M4066</guid>
      <dc:creator>jwhite</dc:creator>
      <dc:date>2014-12-03T16:00:02Z</dc:date>
    </item>
  </channel>
</rss>

