<?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: how to identify conditional values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-identify-conditional-values/m-p/619746#M182023</link>
    <description>&lt;P&gt;Here two possible options.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   input fyear $ inst $  unit;
   datalines;
2013 1030 0
2014 1030 1
2015 1030 1
;

/* option 1 */
proc sort data=have out=inter;
  by inst unit fyear;
run;

data want1;
  set inter;
  by inst unit fyear;
  if first.unit and unit=1 then output;
run;

/* option 2 */
proc sql;
  create table want2 as
  select *
  from have
  where unit=1
  group by inst
  having fyear=min(fyear)
  ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Jan 2020 02:59:16 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2020-01-24T02:59:16Z</dc:date>
    <item>
      <title>how to identify conditional values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-identify-conditional-values/m-p/619726#M182020</link>
      <description>&lt;PRE class="xis-codeFragment"&gt;data test;
   input fyear $ inst $  unit;
   datalines;
2013 1030 0
2014 1030 1&lt;BR /&gt;2015 1030 1
;&lt;/PRE&gt;&lt;P&gt;For the above dataset&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also would appreciate if you can advise how would I identify in which Fiscal year a particular institution started to have the value of 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset as follows&lt;/P&gt;&lt;P&gt;FY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INST&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAS STROKEUNIT&lt;/P&gt;&lt;P&gt;2013&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1030&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;1030&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1030&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the result that inst 1030 started to have the value of 1 in FY 2014&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 00:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-identify-conditional-values/m-p/619726#M182020</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-01-24T00:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to identify conditional values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-identify-conditional-values/m-p/619746#M182023</link>
      <description>&lt;P&gt;Here two possible options.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   input fyear $ inst $  unit;
   datalines;
2013 1030 0
2014 1030 1
2015 1030 1
;

/* option 1 */
proc sort data=have out=inter;
  by inst unit fyear;
run;

data want1;
  set inter;
  by inst unit fyear;
  if first.unit and unit=1 then output;
run;

/* option 2 */
proc sql;
  create table want2 as
  select *
  from have
  where unit=1
  group by inst
  having fyear=min(fyear)
  ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jan 2020 02:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-identify-conditional-values/m-p/619746#M182023</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-01-24T02:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to identify conditional values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-identify-conditional-values/m-p/619870#M182079</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240770"&gt;@Ranjeeta&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE class="xis-codeFragment"&gt;data test;
   input fyear $ inst $  unit;
   datalines;
2013 1030 0
2014 1030 1&lt;BR /&gt;2015 1030 1
;&lt;/PRE&gt;
&lt;P&gt;For the above dataset&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also would appreciate if you can advise how would I identify in which Fiscal year a particular institution started to have the value of 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset as follows&lt;/P&gt;
&lt;P&gt;FY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INST&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAS STROKEUNIT&lt;/P&gt;
&lt;P&gt;2013&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1030&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;1030&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1030&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need the result that inst 1030 started to have the value of 1 in FY 2014&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Any particular reason that FYEAR is character? Since many&amp;nbsp;manipulations of date values involve the numeric values I find it a tad odd.&lt;/P&gt;
&lt;P&gt;If numeric another way would be :&lt;/P&gt;
&lt;PRE&gt;data test;
   input fyear inst $  unit;
   datalines;
2013 1030 0
2014 1030 1
2015 1030 1
;

proc summary data=test nway;
   where unit=1;
   class inst;
   var fyear;
   output out=want (drop=_:) min=;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jan 2020 17:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-identify-conditional-values/m-p/619870#M182079</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-01-24T17:00:24Z</dc:date>
    </item>
  </channel>
</rss>

