<?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: NEED HELP PLEASE. DATA SELECTION in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/NEED-HELP-PLEASE-DATA-SELECTION/m-p/12631#M1708</link>
    <description>Use SAS PROC SUMMARY with MAX and MIN to get your CLASS variable value ranges for selection, creating a separate SAS file.  Then using a DATA step and your data file sorted appropriately, MERGE (with a BY on your CLASS variables) back in the MIN/MAX range file and use IF &lt;LOGIC&gt; THEN OUTPUT;  to subset your data file.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/LOGIC&gt;</description>
    <pubDate>Sun, 29 Mar 2009 13:57:49 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-03-29T13:57:49Z</dc:date>
    <item>
      <title>NEED HELP PLEASE. DATA SELECTION</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/NEED-HELP-PLEASE-DATA-SELECTION/m-p/12630#M1707</link>
      <description>Really need help for the problem as below.&lt;BR /&gt;
This is the pseudo data table. &lt;BR /&gt;
For three stocks, I wanna extract the data between 1 and 2. Dots are the missing values. &lt;BR /&gt;
Note that For Stock B, 2 does not appear on the table. but we still need to select those between date 2.4 and 2.7. &lt;BR /&gt;
&lt;BR /&gt;
I am looking for a generalized codes for performing the selection, as my real data consists of hundreds of stocks. &lt;BR /&gt;
&lt;BR /&gt;
Thank you so much first !!!&lt;BR /&gt;
&lt;BR /&gt;
DATE     STOCK     PRICE   Volume          first/last&lt;BR /&gt;
  1.1           A             .            .&lt;BR /&gt;
  1.2           A            .             .&lt;BR /&gt;
  1.3           A            .            .&lt;BR /&gt;
  1.4           A          0.5          200              1&lt;BR /&gt;
  1.5           A          0.6          1000&lt;BR /&gt;
  1.6           A            .               .&lt;BR /&gt;
  1.7           A           0.5           300            2&lt;BR /&gt;
  1.8            A           .                 .&lt;BR /&gt;
  1,9           A            .               .&lt;BR /&gt;
  2.1           B             .            .                &lt;BR /&gt;
  2.2           B            .             .&lt;BR /&gt;
  2.3           B            .            .&lt;BR /&gt;
  2.4           B          0.75          400           1&lt;BR /&gt;
  2.5           B          0.6          2000&lt;BR /&gt;
  2.6           B            .               .&lt;BR /&gt;
  2.7           B          1..5           300&lt;BR /&gt;
  3.1           C            .               .&lt;BR /&gt;
  3.2            C           .               .&lt;BR /&gt;
 3.3            C            2              5000       1&lt;BR /&gt;
 3.4            C           1.5            2000&lt;BR /&gt;
3.5             C            2              1000&lt;BR /&gt;
3.6             C            1.75          3000      2&lt;BR /&gt;
3.7             C             1.8           5000</description>
      <pubDate>Sun, 29 Mar 2009 07:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/NEED-HELP-PLEASE-DATA-SELECTION/m-p/12630#M1707</guid>
      <dc:creator>Fred_Gavin</dc:creator>
      <dc:date>2009-03-29T07:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: NEED HELP PLEASE. DATA SELECTION</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/NEED-HELP-PLEASE-DATA-SELECTION/m-p/12631#M1708</link>
      <description>Use SAS PROC SUMMARY with MAX and MIN to get your CLASS variable value ranges for selection, creating a separate SAS file.  Then using a DATA step and your data file sorted appropriately, MERGE (with a BY on your CLASS variables) back in the MIN/MAX range file and use IF &lt;LOGIC&gt; THEN OUTPUT;  to subset your data file.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/LOGIC&gt;</description>
      <pubDate>Sun, 29 Mar 2009 13:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/NEED-HELP-PLEASE-DATA-SELECTION/m-p/12631#M1708</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-03-29T13:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: NEED HELP PLEASE. DATA SELECTION</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/NEED-HELP-PLEASE-DATA-SELECTION/m-p/12632#M1709</link>
      <description>I think this will do the job... you will need to change how date is read etc, but you have something to work with (if I understand your question correct)&lt;BR /&gt;
 &lt;BR /&gt;
[pre]data input;&lt;BR /&gt;
  infile datalines missover dlm=" ";&lt;BR /&gt;
  input DATE :$3. STOCK $ PRICE Volume first_last;&lt;BR /&gt;
  datalines;&lt;BR /&gt;
1.1 A . .&lt;BR /&gt;
1.2 A . .&lt;BR /&gt;
1.3 A . .&lt;BR /&gt;
1.4 A 0.5 200 1&lt;BR /&gt;
1.5 A 0.6 1000&lt;BR /&gt;
1.6 A . .&lt;BR /&gt;
1.7 A 0.5 300 2&lt;BR /&gt;
1.8 A . .&lt;BR /&gt;
1.9 A . .&lt;BR /&gt;
2.1 B . . &lt;BR /&gt;
2.2 B . .&lt;BR /&gt;
2.3 B . .&lt;BR /&gt;
2.4 B 0.75 400 1&lt;BR /&gt;
2.5 B 0.6 2000&lt;BR /&gt;
2.6 B . .&lt;BR /&gt;
2.7 B 1.5 300&lt;BR /&gt;
3.1 C . .&lt;BR /&gt;
3.2 C . .&lt;BR /&gt;
3.3 C 2 5000 1&lt;BR /&gt;
3.4 C 1.5 2000&lt;BR /&gt;
3.5 C 2 1000&lt;BR /&gt;
3.6 C 1.75 3000 2&lt;BR /&gt;
3.7 C 1.8 5000 &lt;BR /&gt;
;run;&lt;BR /&gt;
 &lt;BR /&gt;
data result(drop=flag);&lt;BR /&gt;
  retain flag 0;&lt;BR /&gt;
  set input(sortedby=stock);&lt;BR /&gt;
  by stock;&lt;BR /&gt;
  if first.stock then flag=0;&lt;BR /&gt;
  if first_last = 1 then flag=1;&lt;BR /&gt;
  if flag = 1 then output;&lt;BR /&gt;
  if first_last = 2 then flag=0;&lt;BR /&gt;
run;[/pre]</description>
      <pubDate>Sun, 29 Mar 2009 19:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/NEED-HELP-PLEASE-DATA-SELECTION/m-p/12632#M1709</guid>
      <dc:creator>GertNissen</dc:creator>
      <dc:date>2009-03-29T19:19:27Z</dc:date>
    </item>
  </channel>
</rss>

