<?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 Case Statement or other type breakout? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517060#M139719</link>
    <description>&lt;P&gt;So I have two fields, name and type and I am trying to figure how to break this out into more distinct columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name has just different names of users&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Type has different colors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what I am trying to do is:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Name Count of Red Count of Blue Count of Green&lt;BR /&gt;Matt&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; 1&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;&lt;BR /&gt;Ben&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;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;Frank&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&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; 1&lt;/P&gt;</description>
    <pubDate>Thu, 29 Nov 2018 15:00:14 GMT</pubDate>
    <dc:creator>IgawaKei29</dc:creator>
    <dc:date>2018-11-29T15:00:14Z</dc:date>
    <item>
      <title>Case Statement or other type breakout?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517060#M139719</link>
      <description>&lt;P&gt;So I have two fields, name and type and I am trying to figure how to break this out into more distinct columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Name has just different names of users&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Type has different colors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what I am trying to do is:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Name Count of Red Count of Blue Count of Green&lt;BR /&gt;Matt&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; 1&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;&lt;BR /&gt;Ben&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;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;Frank&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&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; 1&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 15:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517060#M139719</guid>
      <dc:creator>IgawaKei29</dc:creator>
      <dc:date>2018-11-29T15:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement or other type breakout?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517069#M139722</link>
      <description>&lt;P&gt;Proc freq your starting data, then transpose the output from the proc freq.&amp;nbsp; Post test data in the form of a datastep if you want actually working code, I am not here to type in test data.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 15:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517069#M139722</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-29T15:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement or other type breakout?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517078#M139725</link>
      <description>&lt;P&gt;You can do that with proc freq and proc transpose:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input name $ type $;
cards;
Matt Red
Matt Red
Matt Red
Matt Red
Matt Blue
Matt Green
Matt Green
;
run;

proc freq data=have;
by name;
table type/  out=inter nocum nocol nopercent;
run;

proc transpose data=inter out=want (drop=_name_ _label_) prefix=count_of_;
by name;
id type;
var count;
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;         count_     count_     count_
name    of_Blue    of_Green    of_Red

Matt       1           2          4  
&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Nov 2018 15:22:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517078#M139725</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-29T15:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement or other type breakout?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517132#M139737</link>
      <description>&lt;P&gt;Do you want a data set (used by computer for other processes) or report (people read it);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One report&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc tabulate data=have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class name color;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; table name,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 16:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517132#M139737</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-29T16:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement or other type breakout?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517176#M139762</link>
      <description>&lt;P&gt;I appreciate all the responses on this.&amp;nbsp; Not used proc transpose a whole lot so this was interesting to see work.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 18:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-Statement-or-other-type-breakout/m-p/517176#M139762</guid>
      <dc:creator>IgawaKei29</dc:creator>
      <dc:date>2018-11-29T18:06:43Z</dc:date>
    </item>
  </channel>
</rss>

