<?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 Where Funktion with the selection of all the variables in a subgroup in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821382#M81902</link>
    <description>&lt;P&gt;Hi dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help with the following function. I'm trying to set a flag&amp;nbsp;(like var2=1) for all the lines where all the variables in the subgroup ProbImgId have the var1 Variable &amp;gt; 2. Here is the database sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ProbId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProbImgId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 &amp;nbsp;&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I look forward to your suggestions. Thanks a lot.&lt;/P&gt;</description>
    <pubDate>Sat, 02 Jul 2022 18:36:44 GMT</pubDate>
    <dc:creator>Zakharkou</dc:creator>
    <dc:date>2022-07-02T18:36:44Z</dc:date>
    <item>
      <title>Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821382#M81902</link>
      <description>&lt;P&gt;Hi dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help with the following function. I'm trying to set a flag&amp;nbsp;(like var2=1) for all the lines where all the variables in the subgroup ProbImgId have the var1 Variable &amp;gt; 2. Here is the database sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ProbId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProbImgId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var1&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 &amp;nbsp;&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I look forward to your suggestions. Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 18:36:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821382#M81902</guid>
      <dc:creator>Zakharkou</dc:creator>
      <dc:date>2022-07-02T18:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821384#M81903</link>
      <description>&lt;P&gt;So you want to ser var2 = 1 only for&amp;nbsp;&lt;SPAN&gt;ProbId= 3 and&amp;nbsp;ProbImgId = 4?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Which value shall var2 get in the other cases?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 19:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821384#M81903</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-07-02T19:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821386#M81904</link>
      <description>No, I want to see var2=1 for all the lines of the ProbId and ProbImgId where var1 &amp;gt; 2. So as shown in this case ProbId=3 and ProbImgId=1--4.&lt;BR /&gt;In other cases, can we set the Variable var2=0.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.</description>
      <pubDate>Sat, 02 Jul 2022 19:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821386#M81904</guid>
      <dc:creator>Zakharkou</dc:creator>
      <dc:date>2022-07-02T19:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821387#M81905</link>
      <description>&lt;P&gt;If I am translating that properly you want to set a flag at the PROBID level (ie the flag has the same value for all observations with the same value of PROBID) that indicates whether ANY of the observations for that level of PRODID had VAR1 larger than 2.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
  select *
       , max( var1&amp;gt;2 ) as FLAG
  from have
  group by PRODID
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS will evaluate a boolean expression, like (var1&amp;gt;2), as 1 for TRUE and 0 for FALSE.&lt;/P&gt;
&lt;P&gt;SAS will automatically remerge the aggregate MAX() function result onto all observations for the group.&lt;/P&gt;
&lt;P&gt;The maximum value will indicate if the expression was ever TRUE.&amp;nbsp; The only way the MAX() could be zero is if it was zero (FALSE) for all of the observations in the group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 20:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821387#M81905</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-07-02T20:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821388#M81906</link>
      <description>Almost everything right except one point - not any but all of the observations.</description>
      <pubDate>Sat, 02 Jul 2022 20:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821388#M81906</guid>
      <dc:creator>Zakharkou</dc:creator>
      <dc:date>2022-07-02T20:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821389#M81907</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/358041"&gt;@Zakharkou&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Almost everything right except one point - not any but all of the observations.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the requirement is that ALL of the observations have VAR1&amp;gt;2 then NONE of the groups meet that criteria.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jul 2022 21:06:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821389#M81907</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-07-02T21:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821390#M81908</link>
      <description>You are right, but it is only an example. Let's make &amp;gt;1 then &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;</description>
      <pubDate>Sat, 02 Jul 2022 21:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821390#M81908</guid>
      <dc:creator>Zakharkou</dc:creator>
      <dc:date>2022-07-02T21:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821392#M81909</link>
      <description>&lt;P&gt;Figure it out.&lt;/P&gt;
&lt;P&gt;Consider these combinations:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;max( var1 &amp;gt; 1)
min( var1 &amp;gt; 1);
max( var1 &amp;lt;= 1);
min(  var1 &amp;lt;= 1);
max(var1) &amp;gt; 1
max(var1) &amp;lt;= 1
min(var1) &amp;gt; 1
min(var1) &amp;lt;= 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Jul 2022 21:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821392#M81909</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-07-02T21:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821393#M81910</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ProbId ProbImgId var1;
cards;
1 1 1
1 2 1
1 3 0
2 1 1
2 2 2
3 1 2
3 2 2  
3 3 2
3 4 3
;

proc sql;
create table want as
  select *
       , max(var1) as max
       , min(var1) as min
       , max(var1) &amp;gt; 1 as any_gt1
       , min(var1) &amp;gt; 1 as all_gt1
  from have
  group by probid
;

proc print;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;       Prob     Prob
Obs     Id     ImgId    var1    max    min    any_gt1    all_gt1

 1       1       3        0      1      0        0          0
 2       1       2        1      1      0        0          0
 3       1       1        1      1      0        0          0
 4       2       2        2      2      1        1          0
 5       2       1        1      2      1        1          0
 6       3       2        2      3      2        1          1
 7       3       1        2      3      2        1          1
 8       3       4        3      3      2        1          1
 9       3       3        2      3      2        1          1
&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Jul 2022 21:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821393#M81910</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-07-02T21:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821397#M81911</link>
      <description>&lt;P&gt;Read each PROBID twice, the first time to see if there are any instances of VAR1&amp;lt;1, the second time to output the wanted data with the validated value of VAR2:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ProbId ProbImgId var1;
cards;
1 1 1
1 2 1
1 3 0
2 1 1
2 2 2
3 1 2
3 2 2  
3 3 2
3 4 3
;
data want;
  set have (in=firstpass)
      have (in=secondpass);
  by probid;
  if first.probid then var2=1;
  retain var2;
  if firstpass=1 and var1&amp;lt;1 then var2=0;
  if secondpass;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Jul 2022 22:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821397#M81911</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-07-02T22:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Where Funktion with the selection of all the variables in a subgroup</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821422#M81912</link>
      <description>It works. Thank You very much!</description>
      <pubDate>Sun, 03 Jul 2022 15:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Where-Funktion-with-the-selection-of-all-the-variables-in-a/m-p/821422#M81912</guid>
      <dc:creator>Zakharkou</dc:creator>
      <dc:date>2022-07-03T15:43:07Z</dc:date>
    </item>
  </channel>
</rss>

