<?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 Wide to Long Dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728781#M28291</link>
    <description>&lt;P&gt;I have this wide dataset structure.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input ID 7. CO2 Methane N2O HFC;
	datalines;
1004377 54 28 54 30
1000112 88 40 72 1
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And I want this long dataset structure.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	input ID 7. Substance $ Amount;
	datalines;
1004377 CO2     54
1004377 Methane 28
1004377 N2O     54
1004377 HFC     30
1000112 CO2     88
1000112 Methane 40
1000112 N2O     72
1000112 HFC     1
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm sure there is an easy way to do this, but can't figure it out. Ideas?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Mar 2021 15:36:32 GMT</pubDate>
    <dc:creator>JJ_83</dc:creator>
    <dc:date>2021-03-24T15:36:32Z</dc:date>
    <item>
      <title>Wide to Long Dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728781#M28291</link>
      <description>&lt;P&gt;I have this wide dataset structure.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input ID 7. CO2 Methane N2O HFC;
	datalines;
1004377 54 28 54 30
1000112 88 40 72 1
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And I want this long dataset structure.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	input ID 7. Substance $ Amount;
	datalines;
1004377 CO2     54
1004377 Methane 28
1004377 N2O     54
1004377 HFC     30
1000112 CO2     88
1000112 Methane 40
1000112 N2O     72
1000112 HFC     1
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm sure there is an easy way to do this, but can't figure it out. Ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728781#M28291</guid>
      <dc:creator>JJ_83</dc:creator>
      <dc:date>2021-03-24T15:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Wide to Long Dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728783#M28292</link>
      <description>&lt;P&gt;Transposing data tutorials:&lt;BR /&gt;Wide to Long:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And sometimes a double transpose is needed for extra wide data sets:&lt;BR /&gt;&lt;A href="https://gist.github.com/statgeek/2321b6f62ab78d5bf2b0a5a8626bd7cd" target="_blank"&gt;https://gist.github.com/statgeek/2321b6f62ab78d5bf2b0a5a8626bd7cd&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329582"&gt;@JJ_83&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have this wide dataset structure.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input ID 7. CO2 Methane N2O HFC;
	datalines;
1004377 54 28 54 30
1000112 88 40 72 1
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And I want this long dataset structure.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	input ID 7. Substance $ Amount;
	datalines;
1004377 CO2     54
1004377 Methane 28
1004377 N2O     54
1004377 HFC     30
1000112 CO2     88
1000112 Methane 40
1000112 N2O     72
1000112 HFC     1
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm sure there is an easy way to do this, but can't figure it out. Ideas?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728783#M28292</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-24T15:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Wide to Long Dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728785#M28293</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want (rename=(_name_=substance col1=amount));
    by id notsorted;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728785#M28293</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2021-03-24T15:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Wide to Long Dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728795#M28296</link>
      <description>&lt;P&gt;I knew it was something simple. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728795#M28296</guid>
      <dc:creator>JJ_83</dc:creator>
      <dc:date>2021-03-24T15:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Wide to Long Dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728796#M28297</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Wide-to-Long-Dataset/m-p/728796#M28297</guid>
      <dc:creator>JJ_83</dc:creator>
      <dc:date>2021-03-24T15:57:36Z</dc:date>
    </item>
  </channel>
</rss>

