<?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: Transpose of complex table #2 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404779#M98389</link>
    <description>&lt;P&gt;Use PROC TRANSPOSE NAME= option to change variable _NAME_ to Statistics&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose name=statistics ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 17 Oct 2017 12:59:38 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2017-10-17T12:59:38Z</dc:date>
    <item>
      <title>Transpose of complex table #2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404762#M98380</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help to transpose the table below as picture - the algorythm. I have attached a code as well. Should it be proc transpose or arrays are more applicable here. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15935i354DA6BFAD9E6328/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.jpg" alt="1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	infile datalines;
	input cat1 cat2 min max mean;
datalines;
1	1	1	9	5
1	2	2	7	4
1	3	3	8	5
1	4	2	8	5
1	5	2	9	4
1	6	1	7	5
1	7	2	9	4
1	8	3	8	4
2	1	4	7	5
2	2	1	8	6
2	3	2	9	5
2	4	3	8	6
2	6	3	8	6
2	7	1	7	5
2	8	2	9	5
3	1	2	7	4
3	3	3	8	5
3	4	3	9	6
3	5	1	8	5
3	6	3	9	4
3	7	1	7	5
3	8	2	9	6
;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 12:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404762#M98380</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-10-17T12:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose of complex table #2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404764#M98382</link>
      <description>&lt;P&gt;Like any process, get your data as you want, then process it:&lt;/P&gt;
&lt;PRE&gt;data inter;
  set have;
  select(cat1);
    when (1) res=max; 
    when (2) res=min;
    when (3) res=median;
   otherwise;
  end;
run;

proc transpose data=inter out=want;
  by cat1;
  var res;
  id cat2;
run;&lt;/PRE&gt;
&lt;P&gt;Then you just format cat1 using the text min/max/median 1/2/3.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 12:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404764#M98382</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-17T12:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose of complex table #2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404769#M98384</link>
      <description>&lt;P&gt;Hi RW9. Thank you for your code. The matter is that the CAT1 does not correspond to Min, Max and Mean. It is just a&amp;nbsp;coincidence. The CAT1 should be left as is.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 12:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404769#M98384</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-10-17T12:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose of complex table #2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404770#M98385</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=test out=test2 prefix=_;
   by cat1;
   id cat2;
   var min max mean;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2017-10-17_7-43-59.png" style="width: 305px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15936iC3E26E6309618DDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="2017-10-17_7-43-59.png" alt="2017-10-17_7-43-59.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 12:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404770#M98385</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-10-17T12:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose of complex table #2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404773#M98386</link>
      <description>&lt;P&gt;It is very simple for PROC TRANSPOSE .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	infile datalines;
	input cat1 cat2 min max mean;
datalines;
1	1	1	9	5
1	2	2	7	4
1	3	3	8	5
1	4	2	8	5
1	5	2	9	4
1	6	1	7	5
1	7	2	9	4
1	8	3	8	4
2	1	4	7	5
2	2	1	8	6
2	3	2	9	5
2	4	3	8	6
2	6	3	8	6
2	7	1	7	5
2	8	2	9	5
3	1	2	7	4
3	3	3	8	5
3	4	3	9	6
3	5	1	8	5
3	6	3	9	4
3	7	1	7	5
3	8	2	9	6
;
run; 
proc transpose data=test out=want;
by cat1;
id cat2;
var min max mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2017 12:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404773#M98386</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-17T12:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose of complex table #2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404774#M98387</link>
      <description>&lt;P&gt;Thank you for the explanations! It has worked.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 12:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404774#M98387</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-10-17T12:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose of complex table #2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404779#M98389</link>
      <description>&lt;P&gt;Use PROC TRANSPOSE NAME= option to change variable _NAME_ to Statistics&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose name=statistics ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2017 12:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-of-complex-table-2/m-p/404779#M98389</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-10-17T12:59:38Z</dc:date>
    </item>
  </channel>
</rss>

