<?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 Finding a cutoff value across years for a specific ID in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829115#M327557</link>
    <description>&lt;P&gt;G'day,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've a question -- I'm trying to find observations below a certain cutoff value across any four years for the same ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the data below and what I tried.&amp;nbsp; I realized it doesn't work.&amp;nbsp; what i want is to have identify in&amp;nbsp; a list that has ids which are below 90 for any four years (Yr), something like the table below.&amp;nbsp; Any help you can give is much appreciated. Or is there a better way to do it in proc sql?&amp;nbsp; Can this be done in the DATA step? Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 672pt;" border="0" width="896" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;id&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2000&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2001&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2002&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2003&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2004&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2005&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2000&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2001&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2002&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2003&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2004&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2005&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;any4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1234567&lt;/TD&gt;
&lt;TD align="right"&gt;88&lt;/TD&gt;
&lt;TD align="right"&gt;90&lt;/TD&gt;
&lt;TD align="right"&gt;57&lt;/TD&gt;
&lt;TD align="right"&gt;95&lt;/TD&gt;
&lt;TD align="right"&gt;77&lt;/TD&gt;
&lt;TD align="right"&gt;62&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1234568&lt;/TD&gt;
&lt;TD align="right"&gt;82&lt;/TD&gt;
&lt;TD align="right"&gt;91&lt;/TD&gt;
&lt;TD align="right"&gt;53&lt;/TD&gt;
&lt;TD align="right"&gt;78&lt;/TD&gt;
&lt;TD align="right"&gt;90&lt;/TD&gt;
&lt;TD align="right"&gt;95&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
*--2017-18 ;
DATA vax;
 INPUT id $ pctvax  yr $;
CARDS;
1234567 88 2000
1234567 90 2001 
1234565 57 2002
1234567 95 2003 
1234567 77 2004
1234567 62 2005 
1234568 82 2000
1234568 91 2001 
1234568 53 2002
1234568 78 2003 
1234568 90 2004
1234568 45 2005 

;
RUN; 

data vax1;
  set vax;
   if yr='2000' then do;
     pctvax2000=pctvax;
     if pctvax2000&amp;lt;90 then pctLT90_2000=1; 
   end;

   if yr='2001' then do;
      pctvax2001=pctvax;
     if pctvax2001&amp;lt;90 then pctLT90_2001=1; 
   end;
   
    if yr='2002' then do;
    pctvax2002=pctvax;
     if pctvax2002&amp;lt;90 then pctLT90_2002=1;      
   end;

      if yr='2003' then do;
     pctvax2003=pctvax;
     if pctvax2003&amp;lt;90 then pctLT90_2003=1; 
   end;

      if yr='2004' then do;
    pctvax2004=pctvax;
     if pctvax2004&amp;lt;90 then pctLT90_2004=1; 
   end;

      if yr='2005' then do;
     pctvax2005=pctvax;
     if pctvax2005&amp;lt;90 then pctLT90_2005=1; 
   end;

   if sum(pctLT90_2000, pctLT90_2001, pctLT90_2002, pctLT90_2003, pctLT90_2004, pctLT90_2005)=4 then  any4=1;
   else any4=0;

   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 20:17:41 GMT</pubDate>
    <dc:creator>jcis7</dc:creator>
    <dc:date>2022-08-17T20:17:41Z</dc:date>
    <item>
      <title>Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829115#M327557</link>
      <description>&lt;P&gt;G'day,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've a question -- I'm trying to find observations below a certain cutoff value across any four years for the same ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the data below and what I tried.&amp;nbsp; I realized it doesn't work.&amp;nbsp; what i want is to have identify in&amp;nbsp; a list that has ids which are below 90 for any four years (Yr), something like the table below.&amp;nbsp; Any help you can give is much appreciated. Or is there a better way to do it in proc sql?&amp;nbsp; Can this be done in the DATA step? Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 672pt;" border="0" width="896" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;id&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2000&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2001&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2002&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2003&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2004&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2005&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2000&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2001&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2002&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2003&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2004&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2005&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;any4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1234567&lt;/TD&gt;
&lt;TD align="right"&gt;88&lt;/TD&gt;
&lt;TD align="right"&gt;90&lt;/TD&gt;
&lt;TD align="right"&gt;57&lt;/TD&gt;
&lt;TD align="right"&gt;95&lt;/TD&gt;
&lt;TD align="right"&gt;77&lt;/TD&gt;
&lt;TD align="right"&gt;62&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1234568&lt;/TD&gt;
&lt;TD align="right"&gt;82&lt;/TD&gt;
&lt;TD align="right"&gt;91&lt;/TD&gt;
&lt;TD align="right"&gt;53&lt;/TD&gt;
&lt;TD align="right"&gt;78&lt;/TD&gt;
&lt;TD align="right"&gt;90&lt;/TD&gt;
&lt;TD align="right"&gt;95&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
*--2017-18 ;
DATA vax;
 INPUT id $ pctvax  yr $;
CARDS;
1234567 88 2000
1234567 90 2001 
1234565 57 2002
1234567 95 2003 
1234567 77 2004
1234567 62 2005 
1234568 82 2000
1234568 91 2001 
1234568 53 2002
1234568 78 2003 
1234568 90 2004
1234568 45 2005 

;
RUN; 

data vax1;
  set vax;
   if yr='2000' then do;
     pctvax2000=pctvax;
     if pctvax2000&amp;lt;90 then pctLT90_2000=1; 
   end;

   if yr='2001' then do;
      pctvax2001=pctvax;
     if pctvax2001&amp;lt;90 then pctLT90_2001=1; 
   end;
   
    if yr='2002' then do;
    pctvax2002=pctvax;
     if pctvax2002&amp;lt;90 then pctLT90_2002=1;      
   end;

      if yr='2003' then do;
     pctvax2003=pctvax;
     if pctvax2003&amp;lt;90 then pctLT90_2003=1; 
   end;

      if yr='2004' then do;
    pctvax2004=pctvax;
     if pctvax2004&amp;lt;90 then pctLT90_2004=1; 
   end;

      if yr='2005' then do;
     pctvax2005=pctvax;
     if pctvax2005&amp;lt;90 then pctLT90_2005=1; 
   end;

   if sum(pctLT90_2000, pctLT90_2001, pctLT90_2002, pctLT90_2003, pctLT90_2004, pctLT90_2005)=4 then  any4=1;
   else any4=0;

   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 20:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829115#M327557</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2022-08-17T20:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829121#M327559</link>
      <description>&lt;P&gt;You say any of the 4 years but you're looking for all 4 years. Is the criteria, any of the 4 years is less than 90% or all of the four years less than 90%?&lt;/P&gt;
&lt;P&gt;Two different approaches below - SQL to generate a single list of IDs or transpose and data step to generate a table more similar to what you have below.&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 listID_lt90 as
select distinct ID
from vax where pctvax &amp;lt;90;
quit;

proc transpose data=vax out=vax_wide prefix=pctvax;
by id;
id year;
var pctvax;
run;

data want;
set vax_wide;
if min(of pctvax:) &amp;lt; 90 then any4 = 1;
else any4=0;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, you may be able to modify our code (untested) by changing this criteria:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; if sum(pctLT90_2000, pctLT90_2001, pctLT90_2002, pctLT90_2003, pctLT90_2004, pctLT90_2005)=4 then  any4=1;
   else any4=0;


 if sum(pctLT90_2000, pctLT90_2001, pctLT90_2002, pctLT90_2003, pctLT90_2004, pctLT90_2005)&amp;gt;0 then  any4=1;
   else any4=0;
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40498"&gt;@jcis7&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;G'day,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've a question -- I'm trying to find observations below a certain cutoff value across any four years for the same ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the data below and what I tried.&amp;nbsp; I realized it doesn't work.&amp;nbsp; what i want is to have identify in&amp;nbsp; a list that has ids which are below 90 for any four years (Yr), something like the table below.&amp;nbsp; Any help you can give is much appreciated. Or is there a better way to do it in proc sql?&amp;nbsp; Can this be done in the DATA step? Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 672pt;" border="0" width="896" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;id&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2000&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2001&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2002&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2003&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2004&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctvax2005&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2000&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2001&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2002&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2003&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2004&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;pctLT90_2005&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;any4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1234567&lt;/TD&gt;
&lt;TD align="right"&gt;88&lt;/TD&gt;
&lt;TD align="right"&gt;90&lt;/TD&gt;
&lt;TD align="right"&gt;57&lt;/TD&gt;
&lt;TD align="right"&gt;95&lt;/TD&gt;
&lt;TD align="right"&gt;77&lt;/TD&gt;
&lt;TD align="right"&gt;62&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1234568&lt;/TD&gt;
&lt;TD align="right"&gt;82&lt;/TD&gt;
&lt;TD align="right"&gt;91&lt;/TD&gt;
&lt;TD align="right"&gt;53&lt;/TD&gt;
&lt;TD align="right"&gt;78&lt;/TD&gt;
&lt;TD align="right"&gt;90&lt;/TD&gt;
&lt;TD align="right"&gt;95&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
*--2017-18 ;
DATA vax;
 INPUT id $ pctvax  yr $;
CARDS;
1234567 88 2000
1234567 90 2001 
1234565 57 2002
1234567 95 2003 
1234567 77 2004
1234567 62 2005 
1234568 82 2000
1234568 91 2001 
1234568 53 2002
1234568 78 2003 
1234568 90 2004
1234568 45 2005 

;
RUN; 

data vax1;
  set vax;
   if yr='2000' then do;
     pctvax2000=pctvax;
     if pctvax2000&amp;lt;90 then pctLT90_2000=1; 
   end;

   if yr='2001' then do;
      pctvax2001=pctvax;
     if pctvax2001&amp;lt;90 then pctLT90_2001=1; 
   end;
   
    if yr='2002' then do;
    pctvax2002=pctvax;
     if pctvax2002&amp;lt;90 then pctLT90_2002=1;      
   end;

      if yr='2003' then do;
     pctvax2003=pctvax;
     if pctvax2003&amp;lt;90 then pctLT90_2003=1; 
   end;

      if yr='2004' then do;
    pctvax2004=pctvax;
     if pctvax2004&amp;lt;90 then pctLT90_2004=1; 
   end;

      if yr='2005' then do;
     pctvax2005=pctvax;
     if pctvax2005&amp;lt;90 then pctLT90_2005=1; 
   end;

   if sum(pctLT90_2000, pctLT90_2001, pctLT90_2002, pctLT90_2003, pctLT90_2004, pctLT90_2005)=4 then  any4=1;
   else any4=0;

   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 20:49:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829121#M327559</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-08-17T20:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829207#M327594</link>
      <description>There are 6 years in the data (2000, 2001, 2002, 2003, 2004, 2005) and looking for IDs where pctvax&amp;lt;90 in any four years, for example:&lt;BR /&gt;Looking for ids with pctvax&amp;lt;90 in the following combination of years&lt;BR /&gt;2000, 2001, 2002, 2003&lt;BR /&gt;2000, 2002, 2003, 2004&lt;BR /&gt;2000, 2001, 2004, 2005&lt;BR /&gt;2001, 2002, 2003, 2004&lt;BR /&gt;Etc....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Aug 2022 14:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829207#M327594</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2022-08-18T14:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829215#M327596</link>
      <description>&lt;P&gt;Work with VAX which is in a good format to provide the information you want. VAX1 isn't as good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table want as select
    id,sum(pctvax&amp;lt;90) as below90
    from vax group by id;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 15:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829215#M327596</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-18T15:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829234#M327605</link>
      <description>Thanks - I'm looking for school year which is in the results of the code you posted. I'm looking for the school year across the top with the school code listed in the column where the current school year is listed in the results of the code you posted.&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Aug 2022 16:28:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829234#M327605</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2022-08-18T16:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829238#M327608</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc transpose data=vax out=vax_wide prefix=pctvax;
by id;
id year;
var pctvax;
run;

data vax_wide1;
  set vax_wide;
 
  if pctvax2000 &amp;lt; 90 then pctvax2000LT90=1;
  if pctvax2001 &amp;lt; 90 then pctvax2001LT90=1;
  if pctvax2002 &amp;lt; 90 then pctvax2002LT90=1;
  if pctvax2003 &amp;lt; 90 then pctvax2003LT90=1;
  if pctvax2004 &amp;lt; 90 then pctvax2004LT90=1;
  if pctvax2005 &amp;lt; 90 then pctvax2005LT90=1;

if sum (pctvax2000LT90, pctvax2001LT90, pctvax2002LT90, pctvax2003LT90, pctvax2004LT90, pctvax2005LT90) =4 then any4=1;
  else any4=0;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This seems code above seems work for the simplified dataset I created.&amp;nbsp; I'm running into a problem where in the actual dataset, it counts missing values as &amp;lt;90. I can post it as a separate post. Thank you everyone for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 16:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829238#M327608</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2022-08-18T16:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829240#M327609</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=vax out=vax_wide prefix=pctvax;
by id;
id year;
var pctvax;
run;

data vax_wide1;
  set vax_wide;
 array pctvax(2000:2005) pctvax2000-pctvax2005;
 array lt90vax(2000:2005) lt90vax2000-lt90vax2005;

*set all to 0;
do year=2000 to 2005;
 lt90vax(year) = 0;
end;

*set to 1 if applicable;
do year=2000 to 2005;
 if not missing(pctvax(year)) and pctvax(year) &amp;lt; 90 then lt90vax(year) = 1;
end;

if sum of lt90vax(*)) =4 then any4=1;
  else any4=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Aug 2022 17:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829240#M327609</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-08-18T17:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829241#M327610</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40498"&gt;@jcis7&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks - I'm looking for school year which is in the results of the code you posted. I'm looking for the school year across the top with the school code listed in the column where the current school year is listed in the results of the code you posted.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is a poor data layout for data analysis, don't do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want this data layout in a report or to create an EXCEL spreadsheet, use PROC REPORT from the original data layout in data set VAX.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 17:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829241#M327610</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-18T17:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829274#M327625</link>
      <description>Great - thank  you!&lt;BR /&gt;&lt;BR /&gt;  *   The code worked until:&lt;BR /&gt;&lt;BR /&gt;401&lt;BR /&gt;402  if sum of lt90vax(*))=4 then any4=1;&lt;BR /&gt;            --&lt;BR /&gt;            22&lt;BR /&gt;            76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: (, [, {.&lt;BR /&gt;&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;&lt;BR /&gt;403    else any4=0;&lt;BR /&gt;404  run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WANT may be incomplete.  When this step was stopped there were 0 observations and 14 variables.&lt;BR /&gt;WARNING: Data set WANT was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;      real time           0.08 seconds&lt;BR /&gt;      cpu time            0.00 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  *   I tried adding a parenthesis and got the following error:&lt;BR /&gt;&lt;BR /&gt;441  end;&lt;BR /&gt;442&lt;BR /&gt;443  if sum of (lt90vax(*))=4 then any4=1;&lt;BR /&gt;            --          -&lt;BR /&gt;            22          386&lt;BR /&gt;            68          200&lt;BR /&gt;                        76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, -, /, ;, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ,&lt;BR /&gt;              GE, GT, LE, LT, MAX, MIN, NE, NG, NL, OR, ^=, |, ||, ~=.&lt;BR /&gt;&lt;BR /&gt;ERROR 386-185: Expecting an arithmetic expression.&lt;BR /&gt;&lt;BR /&gt;ERROR 68-185: The function OF is unknown, or cannot be accessed.&lt;BR /&gt;&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;&lt;BR /&gt;444    else any4=0;&lt;BR /&gt;445  run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set N.WANT may be incomplete.  When this step was stopped there were 0 observations and 14 variables.&lt;BR /&gt;WARNING: Data set N.WANT was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;      real time           0.08 seconds&lt;BR /&gt;      cpu time            0.01 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  *   Then I tried removing the 'of' and got the following error:&lt;BR /&gt;&lt;BR /&gt;461  end;&lt;BR /&gt;462&lt;BR /&gt;463  if sum  (lt90vax(*))=4 then any4=1;&lt;BR /&gt;                      -&lt;BR /&gt;                      386&lt;BR /&gt;                      200&lt;BR /&gt;                      76&lt;BR /&gt;ERROR 386-185: Expecting an arithmetic expression.&lt;BR /&gt;&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;&lt;BR /&gt;464    else any4=0;&lt;BR /&gt;465  run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set N.WANT may be incomplete.  When this step was stopped there were 0 observations and 14 variables.&lt;BR /&gt;WARNING: Data set N.WANT was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;      real time           0.43 seconds&lt;BR /&gt;      cpu time            0.03 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Aug 2022 19:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829274#M327625</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2022-08-18T19:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829276#M327627</link>
      <description>&lt;P&gt;It's missing the opening bracket...I think you should be able to figure where that should go for the sum function &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 19:44:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829276#M327627</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-08-18T19:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a cutoff value across years for a specific ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829293#M327641</link>
      <description>Thank you! I looked up Sum Function and found:  SAS Help Center: SUM Function&amp;lt;&amp;gt;&lt;BR /&gt;So now, this works: &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;BR /&gt;if sum  (of lt90vax(*))=4 then any4=1;&lt;BR /&gt;  else any4=0;&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Aug 2022 21:18:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-cutoff-value-across-years-for-a-specific-ID/m-p/829293#M327641</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2022-08-18T21:18:30Z</dc:date>
    </item>
  </channel>
</rss>

