<?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: Summary of flags in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Summary-of-flags/m-p/398201#M96283</link>
    <description>&lt;P&gt;Another way if you prefer proc sql-&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, max(flag1) as flag1, max(flag2) as flag2, max(flag3) as flag3, max(flag4) as flag4 from have group by id;

quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2017 18:36:22 GMT</pubDate>
    <dc:creator>devsas</dc:creator>
    <dc:date>2017-09-22T18:36:22Z</dc:date>
    <item>
      <title>Summary of flags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-of-flags/m-p/398182#M96273</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;For your kind information, I am trying to create a summary of flags per record where flags are coming from multiple rows for each ID as shown in the data. Can anybody help me to write sascode to move forward to achieve the goal (without splitting and merging the tables)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id $ flag1  flag2  flag3 flag4 ;
datalines;
101 1 0 0 1
101 0 1 0 0
102 0 0 0 1
102 0 0 1 0
102 1 0 1 0
103 1 1 0 0
103 1 1 1 0
103 1 0 0 0
;
run;


data want;
input id $ flag1  flag2  flag3 flag4 ;
datalines;
101 1 1 0 1
102 1 0 1 1
103 1 1 1 1
;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you in advance for your kind reply.&lt;BR /&gt;Regards,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 17:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-of-flags/m-p/398182#M96273</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2017-09-22T17:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Summary of flags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-of-flags/m-p/398189#M96276</link>
      <description>&lt;P&gt;One way of several&lt;/P&gt;
&lt;PRE&gt;proc summary data=have nway;
   class id;
   var flag: ;
   output out=want (drop=_:) max=;
run;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Sep 2017 17:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-of-flags/m-p/398189#M96276</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-22T17:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Summary of flags</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-of-flags/m-p/398201#M96283</link>
      <description>&lt;P&gt;Another way if you prefer proc sql-&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, max(flag1) as flag1, max(flag2) as flag2, max(flag3) as flag3, max(flag4) as flag4 from have group by id;

quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 18:36:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-of-flags/m-p/398201#M96283</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2017-09-22T18:36:22Z</dc:date>
    </item>
  </channel>
</rss>

