<?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 Change structure of a table  from  long to 2 dimensional table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-structure-of-a-table-from-long-to-2-dimensional-table/m-p/616160#M180341</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;The following raw data table is a summary table that includes 4 categorical variables and 1 numeric variable.&lt;/P&gt;
&lt;P&gt;It contains 42 rows.&lt;/P&gt;
&lt;P&gt;I want to display the table in a different way where there is 2 dimensional table:&lt;/P&gt;
&lt;P&gt;In X-axis there will be 2&amp;nbsp; categorical variables :Z1+Z2 (Z1 has 2 levels, Z2 has 3 levels)&lt;/P&gt;
&lt;P&gt;In Y-axis there will be 2&amp;nbsp; categorical variables :Z3+Z4 (Z3 has 2 levels&amp;nbsp; ,Z4 has 3 levels)&lt;/P&gt;
&lt;P&gt;When the value of a category is same for multiple cells then it is better to display it as one value&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Report_tbl;
INFILE DATALINES DLM=',';
input Z4 $	Z3 $	Z2 $	Z1 $	Y ;
cards;
1,Max,None,None,10489
1,Max,30,20000,9437
1,Max,40,20000,8974
1,Max,50,20000,8443
1,Max,30,50000,8302
1,Max,40,50000,7358
1,Max,50,50000,6269
1.1,Max,None,None,9652
1.1,Max,30,20000,8275
1.1,Max,40,20000,7783
1.1,Max,50,20000,7678
1.1,Max,30,50000,6815
1.1,Max,40,50000,5809
1.1,Max,50,50000,8702
1.2,Max,None,None,8921
1.2,Max,30,20000,8055
1.2,Max,40,20000,7662
1.2,Max,50,20000,7204
1.2,Max,30,50000,7124
1.2,Max,40,50000,6331
1.2,Max,50,50000,5401
1,Second_Max,None,None,12121
1,Second_Max,30,20000,10801
1,Second_Max,40,20000,10266
1,Second_Max,50,20000,9671
1,Second_Max,30,50000,9363
1,Second_Max,40,50000,8267
1,Second_Max,50,50000,7036
1.1,Second_Max,None,None,11323
1.1,Second_Max,30,20000,10115
1.1,Second_Max,40,20000,9615
1.1,Second_Max,50,20000,9054
1.1,Second_Max,30,50000,8806
1.1,Second_Max,40,50000,7787
1.1,Second_Max,50,50000,6632
1.2,Second_Max,None,None,10605
1.2,Second_Max,30,20000,9493
1.2,Second_Max,40,20000,9026
1.2,Second_Max,50,20000,8496
1.2,Second_Max,30,50000,8291
1.2,Second_Max,40,50000,7342
1.2,Second_Max,50,50000,6258
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2020 10:31:12 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2020-01-09T10:31:12Z</dc:date>
    <item>
      <title>Change structure of a table  from  long to 2 dimensional table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-structure-of-a-table-from-long-to-2-dimensional-table/m-p/616160#M180341</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;The following raw data table is a summary table that includes 4 categorical variables and 1 numeric variable.&lt;/P&gt;
&lt;P&gt;It contains 42 rows.&lt;/P&gt;
&lt;P&gt;I want to display the table in a different way where there is 2 dimensional table:&lt;/P&gt;
&lt;P&gt;In X-axis there will be 2&amp;nbsp; categorical variables :Z1+Z2 (Z1 has 2 levels, Z2 has 3 levels)&lt;/P&gt;
&lt;P&gt;In Y-axis there will be 2&amp;nbsp; categorical variables :Z3+Z4 (Z3 has 2 levels&amp;nbsp; ,Z4 has 3 levels)&lt;/P&gt;
&lt;P&gt;When the value of a category is same for multiple cells then it is better to display it as one value&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Report_tbl;
INFILE DATALINES DLM=',';
input Z4 $	Z3 $	Z2 $	Z1 $	Y ;
cards;
1,Max,None,None,10489
1,Max,30,20000,9437
1,Max,40,20000,8974
1,Max,50,20000,8443
1,Max,30,50000,8302
1,Max,40,50000,7358
1,Max,50,50000,6269
1.1,Max,None,None,9652
1.1,Max,30,20000,8275
1.1,Max,40,20000,7783
1.1,Max,50,20000,7678
1.1,Max,30,50000,6815
1.1,Max,40,50000,5809
1.1,Max,50,50000,8702
1.2,Max,None,None,8921
1.2,Max,30,20000,8055
1.2,Max,40,20000,7662
1.2,Max,50,20000,7204
1.2,Max,30,50000,7124
1.2,Max,40,50000,6331
1.2,Max,50,50000,5401
1,Second_Max,None,None,12121
1,Second_Max,30,20000,10801
1,Second_Max,40,20000,10266
1,Second_Max,50,20000,9671
1,Second_Max,30,50000,9363
1,Second_Max,40,50000,8267
1,Second_Max,50,50000,7036
1.1,Second_Max,None,None,11323
1.1,Second_Max,30,20000,10115
1.1,Second_Max,40,20000,9615
1.1,Second_Max,50,20000,9054
1.1,Second_Max,30,50000,8806
1.1,Second_Max,40,50000,7787
1.1,Second_Max,50,50000,6632
1.2,Second_Max,None,None,10605
1.2,Second_Max,30,20000,9493
1.2,Second_Max,40,20000,9026
1.2,Second_Max,50,20000,8496
1.2,Second_Max,30,50000,8291
1.2,Second_Max,40,50000,7342
1.2,Second_Max,50,50000,6258
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 10:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-structure-of-a-table-from-long-to-2-dimensional-table/m-p/616160#M180341</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-01-09T10:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Change structure of a table  from  long to 2 dimensional table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-structure-of-a-table-from-long-to-2-dimensional-table/m-p/616167#M180348</link>
      <description>&lt;P&gt;Seems to be a problem solved by proc tabulate if you want a report. If you want a 2 dim table as dataset, i have to ask: why? That structure is hardly useful for any form of further processing.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 12:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-structure-of-a-table-from-long-to-2-dimensional-table/m-p/616167#M180348</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-01-09T12:21:26Z</dc:date>
    </item>
  </channel>
</rss>

