<?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 Question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440686#M110147</link>
    <description>&lt;OL&gt;
&lt;LI&gt;Transpose by product year first. Then you'll have a column with the _name_, with 'sales_jan'&lt;/LI&gt;
&lt;LI&gt;Use SCAN() to get the Month, Jan&lt;/LI&gt;
&lt;LI&gt;Use INPUT() to convert that to a SAS date&lt;/LI&gt;
&lt;LI&gt;USE MONTH() to calculate the month&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Or replace steps 2-4 with a set of 13 IF/THEN statements, one for each month and one to catch errors.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2018 22:21:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-27T22:21:20Z</dc:date>
    <item>
      <title>Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440683#M110146</link>
      <description>&lt;P&gt;If I have a data with these variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;product&amp;nbsp; &amp;nbsp;year&amp;nbsp; &amp;nbsp;sales_jan&amp;nbsp; &amp;nbsp;sales_feb&amp;nbsp; &amp;nbsp;sales_mar....sales_nov&amp;nbsp; &amp;nbsp;sales_dec&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I transpose it to something like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;product&amp;nbsp; &amp;nbsp;year&amp;nbsp; &amp;nbsp;month&amp;nbsp; &amp;nbsp;sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Month is a number (1-12).Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 22:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440683#M110146</guid>
      <dc:creator>apolitical</dc:creator>
      <dc:date>2018-02-27T22:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440686#M110147</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Transpose by product year first. Then you'll have a column with the _name_, with 'sales_jan'&lt;/LI&gt;
&lt;LI&gt;Use SCAN() to get the Month, Jan&lt;/LI&gt;
&lt;LI&gt;Use INPUT() to convert that to a SAS date&lt;/LI&gt;
&lt;LI&gt;USE MONTH() to calculate the month&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Or replace steps 2-4 with a set of 13 IF/THEN statements, one for each month and one to catch errors.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 22:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440686#M110147</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-27T22:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440693#M110148</link>
      <description>&lt;P&gt;I would use a DATA step, and create MONTH as a numeric variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;array monsales {12} sales_jan sales_feb sales_mar sales_apr sales_may sales_jun&lt;/P&gt;
&lt;P&gt;sales_jul sales_aug sales_sep sales_oct sales_nov sales_dec;&lt;/P&gt;
&lt;P&gt;do month = 1 to 12;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;sales = monsales{month};&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;output;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;drop sales_: ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 23:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440693#M110148</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-27T23:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440698#M110150</link>
      <description>Works like a beauty. Thank you.</description>
      <pubDate>Tue, 27 Feb 2018 23:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440698#M110150</guid>
      <dc:creator>apolitical</dc:creator>
      <dc:date>2018-02-27T23:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440699#M110151</link>
      <description>Admittedly I don't know much about proc transpose. Because the month are in letters not numbers in the variable names, my attempt results in error stating " QTY_JAN does not have a numeric suffix".&lt;BR /&gt;Thank you nonetheless.</description>
      <pubDate>Tue, 27 Feb 2018 23:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-Question/m-p/440699#M110151</guid>
      <dc:creator>apolitical</dc:creator>
      <dc:date>2018-02-27T23:26:37Z</dc:date>
    </item>
  </channel>
</rss>

