<?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 Proc Transpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/300540#M63477</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to reshape my dataset but stuck in one thing. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Raw Data -&lt;/P&gt;
&lt;TABLE width="169"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="91"&gt;Year&lt;/TD&gt;
&lt;TD width="42"&gt;Boys&lt;/TD&gt;
&lt;TD width="36"&gt;Girls&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="91"&gt;1879&lt;/TD&gt;
&lt;TD width="42"&gt;.&lt;/TD&gt;
&lt;TD width="36"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="91"&gt;1880&lt;/TD&gt;
&lt;TD width="42"&gt;490&lt;/TD&gt;
&lt;TD width="36"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="91"&gt;1881&lt;/TD&gt;
&lt;TD width="42"&gt;481&lt;/TD&gt;
&lt;TD width="36"&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired Output -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" span="3" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl65" style="height: 15.0pt; width: 48pt;" width="64" height="20"&gt;Year&lt;/TD&gt;
&lt;TD class="xl66" style="border-left: none; width: 48pt;" width="64"&gt;Gender&lt;/TD&gt;
&lt;TD class="xl67" style="border-left: none; width: 48pt;" width="64"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1879&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Boys&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1879&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Girls&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1880&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Boys&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;490&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1880&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Girls&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1881&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Boys&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;481&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1881&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Girls&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using code below which does not give desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data = years&amp;nbsp; out=years1(drop= _:) label=DESC PREFIX = Gender; &lt;BR /&gt;by&amp;nbsp; Year;&lt;BR /&gt;/*id Boys Girls;*/&lt;BR /&gt;VAR Boys Girls;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;KR&lt;/P&gt;
&lt;P&gt;SK&lt;/P&gt;</description>
    <pubDate>Sat, 24 Sep 2016 12:54:39 GMT</pubDate>
    <dc:creator>Siddharth123</dc:creator>
    <dc:date>2016-09-24T12:54:39Z</dc:date>
    <item>
      <title>Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/300540#M63477</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to reshape my dataset but stuck in one thing. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Raw Data -&lt;/P&gt;
&lt;TABLE width="169"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="91"&gt;Year&lt;/TD&gt;
&lt;TD width="42"&gt;Boys&lt;/TD&gt;
&lt;TD width="36"&gt;Girls&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="91"&gt;1879&lt;/TD&gt;
&lt;TD width="42"&gt;.&lt;/TD&gt;
&lt;TD width="36"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="91"&gt;1880&lt;/TD&gt;
&lt;TD width="42"&gt;490&lt;/TD&gt;
&lt;TD width="36"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="91"&gt;1881&lt;/TD&gt;
&lt;TD width="42"&gt;481&lt;/TD&gt;
&lt;TD width="36"&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired Output -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" span="3" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl65" style="height: 15.0pt; width: 48pt;" width="64" height="20"&gt;Year&lt;/TD&gt;
&lt;TD class="xl66" style="border-left: none; width: 48pt;" width="64"&gt;Gender&lt;/TD&gt;
&lt;TD class="xl67" style="border-left: none; width: 48pt;" width="64"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1879&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Boys&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1879&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Girls&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1880&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Boys&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;490&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1880&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Girls&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1881&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Boys&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;481&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD class="xl68" style="height: 15.0pt; border-top: none; width: 48pt;" width="64" height="20"&gt;1881&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;Girls&lt;/TD&gt;
&lt;TD class="xl69" style="border-top: none; border-left: none; width: 48pt;" width="64"&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using code below which does not give desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc transpose data = years&amp;nbsp; out=years1(drop= _:) label=DESC PREFIX = Gender; &lt;BR /&gt;by&amp;nbsp; Year;&lt;BR /&gt;/*id Boys Girls;*/&lt;BR /&gt;VAR Boys Girls;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;KR&lt;/P&gt;
&lt;P&gt;SK&lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2016 12:54:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/300540#M63477</guid>
      <dc:creator>Siddharth123</dc:creator>
      <dc:date>2016-09-24T12:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/300541#M63478</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data = years  label=DESC name = Gender
  out=years1 (rename=(col1=Count)) 
; 
  by  Year;
  var Boys Girls;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Sep 2016 13:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose/m-p/300541#M63478</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-24T13:10:00Z</dc:date>
    </item>
  </channel>
</rss>

