<?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 Convert Access query to SAS SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-Access-query-to-SAS-SQL/m-p/237234#M43483</link>
    <description>&lt;P&gt;I am trying to convert an Access query into a SAS SQL. &amp;nbsp;I have struggled with converting the following SQL statement in Access to SAS:&lt;/P&gt;&lt;P&gt;IIf([LCLSTACK-BKY].Unit="OVEC-K Min" Or [LCLSTACK-BKY].Unit="OVEC-K Max" Or [LCLSTACK-BKY].Unit="OVEC-L Min" Or [LCLSTACK-BKY].Unit="OVEC-L Max" Or [CompanyOwner]="OMU" And [CounterParty]=" KU","PP",IIf([CompanyOwner]="MarketP","PU","PG")) AS MW_Type&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to code the above in SAS SQL?&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2015 19:01:33 GMT</pubDate>
    <dc:creator>CHW8</dc:creator>
    <dc:date>2015-12-01T19:01:33Z</dc:date>
    <item>
      <title>Convert Access query to SAS SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Access-query-to-SAS-SQL/m-p/237234#M43483</link>
      <description>&lt;P&gt;I am trying to convert an Access query into a SAS SQL. &amp;nbsp;I have struggled with converting the following SQL statement in Access to SAS:&lt;/P&gt;&lt;P&gt;IIf([LCLSTACK-BKY].Unit="OVEC-K Min" Or [LCLSTACK-BKY].Unit="OVEC-K Max" Or [LCLSTACK-BKY].Unit="OVEC-L Min" Or [LCLSTACK-BKY].Unit="OVEC-L Max" Or [CompanyOwner]="OMU" And [CounterParty]=" KU","PP",IIf([CompanyOwner]="MarketP","PU","PG")) AS MW_Type&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to code the above in SAS SQL?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 19:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Access-query-to-SAS-SQL/m-p/237234#M43483</guid>
      <dc:creator>CHW8</dc:creator>
      <dc:date>2015-12-01T19:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Access query to SAS SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Access-query-to-SAS-SQL/m-p/237253#M43490</link>
      <description>&lt;P&gt;SAS is mainly ANSI SQL.&lt;/P&gt;
&lt;P&gt;I'm&amp;nbsp; not very familiar with MS Access SQL, but is this conditional assignments?&lt;/P&gt;
&lt;P&gt;Doesn't look the full query, I'm missing Select and From clauses.&lt;/P&gt;
&lt;P&gt;To use conditional assignments, use the case - when - then - else construct.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 20:29:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Access-query-to-SAS-SQL/m-p/237253#M43490</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-12-01T20:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Access query to SAS SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Access-query-to-SAS-SQL/m-p/237286#M43495</link>
      <description>It's a case statement to create a new variable - break out the logic from your current code and convert it to a CASE statement. It looks like two conditions and an ELSE. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473682.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473682.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt; 1. LCLSTACK-BKY].Unit="OVEC-K Min" Or [LCLSTACK-BKY].Unit="OVEC-K Max" Or [LCLSTACK-BKY].Unit="OVEC-L Min" Or [LCLSTACK-BKY].Unit="OVEC-L Max" Or [CompanyOwner]="OMU" And [CounterParty]=" KU"&lt;BR /&gt;-&amp;gt; "PP"&lt;BR /&gt;2. [CompanyOwner]="MarketP" -&amp;gt; "PU"&lt;BR /&gt;3. ELSE "PG"&lt;BR /&gt;&lt;BR /&gt;You should verify the order of the conditions in that first condition as I'm not sure how the multiple OR with the AND would resolve. Make sure it meets your business needs. &lt;BR /&gt;</description>
      <pubDate>Wed, 02 Dec 2015 00:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Access-query-to-SAS-SQL/m-p/237286#M43495</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-02T00:38:59Z</dc:date>
    </item>
  </channel>
</rss>

