<?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 proc sql:  the where clause in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-the-where-clause/m-p/717171#M221752</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering about the "where" clause in sql code. I need to apply the where clause in the beginning only for the PSAEU11.DB_DOSSIER data, but I suppose that my syntaxe is not right.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc  sql;
create table test as select rga.cd_rga,sousc.no_police from PSAEU11.db_dossier sousc (where sousc.cd_dossier = 'SOUSC' and sousc.lp_etat_doss not in ('ANNUL','A30','IMPAY') and sousc.no_police = 'I99300001') left join  PSAEU11.db_garantie gar on sousc.is_protocole=gar.is_protocole and gar.cd_garantie='DEDIE' 
    left join PSAEU11.db_ctrat_support ctrats on ctrats.is_garantie = gar.is_garantie and ctrats.is_dossier = sousc.is_dossier 
    left join PSAEU11.db_param_mandat_op mandaop on ctrats.is_param_mandat_op = mandaop.is_param_mandat_op  
    left join PSAEU11.db_rga rga on mandaop.is_rga=rga.is_rga ;
	quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you for your help !&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2021 18:43:21 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2021-02-05T18:43:21Z</dc:date>
    <item>
      <title>proc sql:  the where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-the-where-clause/m-p/717171#M221752</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering about the "where" clause in sql code. I need to apply the where clause in the beginning only for the PSAEU11.DB_DOSSIER data, but I suppose that my syntaxe is not right.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc  sql;
create table test as select rga.cd_rga,sousc.no_police from PSAEU11.db_dossier sousc (where sousc.cd_dossier = 'SOUSC' and sousc.lp_etat_doss not in ('ANNUL','A30','IMPAY') and sousc.no_police = 'I99300001') left join  PSAEU11.db_garantie gar on sousc.is_protocole=gar.is_protocole and gar.cd_garantie='DEDIE' 
    left join PSAEU11.db_ctrat_support ctrats on ctrats.is_garantie = gar.is_garantie and ctrats.is_dossier = sousc.is_dossier 
    left join PSAEU11.db_param_mandat_op mandaop on ctrats.is_param_mandat_op = mandaop.is_param_mandat_op  
    left join PSAEU11.db_rga rga on mandaop.is_rga=rga.is_rga ;
	quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you for your help !&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 18:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-the-where-clause/m-p/717171#M221752</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2021-02-05T18:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql:  the where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-the-where-clause/m-p/717173#M221754</link>
      <description>&lt;P&gt;This is where some SAS is interjected into SQL syntax for PROC SQL, namely the SAS dataset options.&amp;nbsp; Try this&lt;/P&gt;
&lt;P&gt;replace this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*...*/&lt;BR /&gt;from PSAEU11.db_dossier sousc (where sousc.cd_dossier = 'SOUSC' and sousc.lp_etat_doss not in ('ANNUL','A30','IMPAY') and sousc.no_police = 'I99300001') left join  /*...*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*...*/&lt;BR /&gt;      from PSAEU11.db_dossier (where=(cd_dossier = 'SOUSC' 
                                  and lp_etat_doss not in ('ANNUL','A30','IMPAY') 
                                  and no_police = 'I99300001')) as sousc left join /*...*/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This little example works as well&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   select cars.Make, cars.model
     from SASHELP.CARS(where=(Make="Audi")) as cars;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Feb 2021 18:55:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-the-where-clause/m-p/717173#M221754</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-02-05T18:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql:  the where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-the-where-clause/m-p/717174#M221755</link>
      <description>&lt;P&gt;give this a whirl...&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc  sql;
create table test as 
select rga.cd_rga,sousc.no_police 
from 
	(SELECT * FROM PSAEU11.db_dossier where cd_dossier = 'SOUSC' and lp_etat_doss not in ('ANNUL','A30','IMPAY') and no_police = 'I99300001') sousc
	left join PSAEU11.db_garantie gar on sousc.is_protocole=gar.is_protocole and gar.cd_garantie='DEDIE' 
    left join PSAEU11.db_ctrat_support ctrats on ctrats.is_garantie = gar.is_garantie and ctrats.is_dossier = sousc.is_dossier 
    left join PSAEU11.db_param_mandat_op mandaop on ctrats.is_param_mandat_op = mandaop.is_param_mandat_op  
    left join PSAEU11.db_rga rga on mandaop.is_rga=rga.is_rga 
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Feb 2021 18:56:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-the-where-clause/m-p/717174#M221755</guid>
      <dc:creator>utrocketeng</dc:creator>
      <dc:date>2021-02-05T18:56:01Z</dc:date>
    </item>
  </channel>
</rss>

