<?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 how to make a select in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/554975#M33598</link>
    <description>&lt;P&gt;hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry, the question may seem very simple, but I am new with SAS and seems cant to do the task in allotted time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;writing on SQLLite (&lt;FONT&gt;&lt;A href="https://www.jdoodle.com" target="_blank" rel="noopener"&gt;https://www.jdoodle.com&lt;/A&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;my table looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;create table 't1' (id int, typ int, dt date, qty int);
insert into t1 values (1, 2, '20190325', 50), (2, 2, '20190320', 15), (3, 3, '20190401', 50), (4, 3, '20190405', 5), (5, 1, '20190406', 25), (6, 2, '20190411', 5), (7, 3, '20190412', 15);
select id, typ, dt, qty 
from t1;&lt;/PRE&gt;I have to make a select to this table with the condition on the date '20190410' and as a result I want to see this talbe:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #eeeeee; border-collapse: separate; color: #222222; cursor: text; font-family: Arial,Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;2|2|20190320|15&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #eeeeee; border-collapse: separate; color: #222222; cursor: text; font-family: Arial,Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;4|3|20190405|5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #eeeeee; border-collapse: separate; color: #222222; cursor: text; font-family: Arial,Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;5|1|20190406|25&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;that is, for each TYP field, the values of the DATE and QTY fields are required with a DATE value most preceding for the date in the condition.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&lt;BR /&gt;please tell me, how such a request could be realised?&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;best regards&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 30 Apr 2019 10:21:05 GMT</pubDate>
    <dc:creator>Ivan555</dc:creator>
    <dc:date>2019-04-30T10:21:05Z</dc:date>
    <item>
      <title>how to make a select</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/554975#M33598</link>
      <description>&lt;P&gt;hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sorry, the question may seem very simple, but I am new with SAS and seems cant to do the task in allotted time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;writing on SQLLite (&lt;FONT&gt;&lt;A href="https://www.jdoodle.com" target="_blank" rel="noopener"&gt;https://www.jdoodle.com&lt;/A&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;my table looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;create table 't1' (id int, typ int, dt date, qty int);
insert into t1 values (1, 2, '20190325', 50), (2, 2, '20190320', 15), (3, 3, '20190401', 50), (4, 3, '20190405', 5), (5, 1, '20190406', 25), (6, 2, '20190411', 5), (7, 3, '20190412', 15);
select id, typ, dt, qty 
from t1;&lt;/PRE&gt;I have to make a select to this table with the condition on the date '20190410' and as a result I want to see this talbe:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #eeeeee; border-collapse: separate; color: #222222; cursor: text; font-family: Arial,Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;2|2|20190320|15&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #eeeeee; border-collapse: separate; color: #222222; cursor: text; font-family: Arial,Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;4|3|20190405|5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #eeeeee; border-collapse: separate; color: #222222; cursor: text; font-family: Arial,Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;5|1|20190406|25&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;that is, for each TYP field, the values of the DATE and QTY fields are required with a DATE value most preceding for the date in the condition.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&lt;BR /&gt;please tell me, how such a request could be realised?&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;best regards&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 30 Apr 2019 10:21:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/554975#M33598</guid>
      <dc:creator>Ivan555</dc:creator>
      <dc:date>2019-04-30T10:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a select</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/555011#M33599</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table t1 (id int, typ int, dt char(8), qty int);
insert into t1 
values (1, 2, '20190325', 50)
 values (2, 2, '20190320', 15)
  values (3, 3, '20190401', 50)
   values (4, 3, '20190405', 5)
    values (5, 1, '20190406', 25)
     values (6, 2, '20190411', 5)
      values (7, 3, '20190412', 15);
create table t2 as select id, a.typ, input(dt,yymmdd8.) as date format=date9.,dt, qty 
from t1(where=(input(dt,yymmdd8.) &amp;lt; '10Apr2019'd )) a  
inner join (
    select typ, max(input(dt,yymmdd8.)) as MaxDate
    from t1(where=(input(dt,yymmdd8.) &amp;lt; '10Apr2019'd)) 
    group by typ
) b on input(a.dt,yymmdd8.)=b.MaxDate;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Apr 2019 13:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/555011#M33599</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-04-30T13:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a select</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/555066#M33600</link>
      <description>&lt;P&gt;Thank you very much, Jag!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a good weekend!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 14:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/555066#M33600</guid>
      <dc:creator>Ivan555</dc:creator>
      <dc:date>2019-04-30T14:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a select</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/555072#M33601</link>
      <description>Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/272354"&gt;@Ivan555&lt;/a&gt; &lt;BR /&gt;Could you please Mark answers as helpful and correct as appropriate. It helps future users narrow down what responses to look at</description>
      <pubDate>Tue, 30 Apr 2019 14:58:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/555072#M33601</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-04-30T14:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a select</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/555084#M33602</link>
      <description>&lt;P&gt;&lt;FONT&gt;no problem, done.&lt;BR /&gt;I am thinking, the topic name is not informative.. sorry.&lt;BR /&gt;next time I create a new one, I will think how formulate the topic name more correctly&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 15:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-make-a-select/m-p/555084#M33602</guid>
      <dc:creator>Ivan555</dc:creator>
      <dc:date>2019-04-30T15:18:38Z</dc:date>
    </item>
  </channel>
</rss>

