<?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: grouping the data while extract it from database by where clause in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/grouping-the-data-while-extract-it-from-database-by-where-clause/m-p/717012#M221700</link>
    <description>&lt;P&gt;Since you are using SQL pass through, this is not a SAS question really.&lt;/P&gt;
&lt;P&gt;You should redirect this optimization inquire to forum specific for your source database.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2021 09:42:26 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2021-02-05T09:42:26Z</dc:date>
    <item>
      <title>grouping the data while extract it from database by where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/grouping-the-data-while-extract-it-from-database-by-where-clause/m-p/716998#M221692</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I want to extract the most recent date from my data in each group. It's easy when I have a table ready. But when I want to extract from my metadata it doesn't work. especially with a where clause. My data is tooooooooo big. So I can't extract everything and then group it. Please help me. I used &lt;CODE class=" language-sas"&gt;max(qtm.kalenderday) for&amp;nbsp;the&amp;nbsp;last&amp;nbsp;data.&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
	CONNECT TO ODBC AS mycon (datasrc=DMA_P);
	CREATE TABLE work.Company AS

	select *
		FROM CONNECTION TO mycon 
			(SELECT	
				qtm. Day,
				qtm. NR,
				qtm.name,
                qtm.kalenderday,
                qvm.WGnumber
				
			FROM dmameting_tr qvm,
				dm_ameting qtm,
				dmameting_wh WiK
		
			where
				qtm.qtmunitnr = WiK.meetunitnr
				and qtm.unitnr = qvm.unitnr 
				and qtm.meettijdstip_dt = qvm.meettijdstip_dt
				and max(qtm.kalenderday)
                group by qvm.WGnumber
			);
run;

DISCONNECT FROM mycon;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Feb 2021 08:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/grouping-the-data-while-extract-it-from-database-by-where-clause/m-p/716998#M221692</guid>
      <dc:creator>BaharH</dc:creator>
      <dc:date>2021-02-05T08:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: grouping the data while extract it from database by where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/grouping-the-data-while-extract-it-from-database-by-where-clause/m-p/717012#M221700</link>
      <description>&lt;P&gt;Since you are using SQL pass through, this is not a SAS question really.&lt;/P&gt;
&lt;P&gt;You should redirect this optimization inquire to forum specific for your source database.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 09:42:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/grouping-the-data-while-extract-it-from-database-by-where-clause/m-p/717012#M221700</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2021-02-05T09:42:26Z</dc:date>
    </item>
  </channel>
</rss>

