<?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: proc transpose two variables (kind of) in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584697#M14221</link>
    <description>Seems like a straight forward proc transpose. Use ID and IDLABEL to specify the naming variable.&lt;BR /&gt;You may need to sort first if you have more than one site id. &lt;BR /&gt;&lt;BR /&gt;proc transpose data=have out=want;&lt;BR /&gt;by site_id;&lt;BR /&gt;var s1_6_tot;&lt;BR /&gt;id quarter_year;&lt;BR /&gt;idlabel quarter_year;&lt;BR /&gt;run;&lt;BR /&gt;</description>
    <pubDate>Wed, 28 Aug 2019 18:02:50 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-08-28T18:02:50Z</dc:date>
    <item>
      <title>proc transpose two variables (kind of)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584694#M14219</link>
      <description>&lt;P&gt;I'm wondering if there is a way to transpose two variables at once using proc transpose... but one variable would essentially be transposed as the column names... Or can you utilize prefix= to call on an existing variable to name the columns?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data looks like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Site_ID&amp;nbsp; &amp;nbsp; S1_6_tot&amp;nbsp; &amp;nbsp; Quarter_Year&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 35&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Q1 2017&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Q2 2017&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 81&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Q3 2017&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 126&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Q4 2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially I would like the pertinent Quarter Year to be the name of the column and have the S1_6_tot number the column value like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Site_ID&amp;nbsp; &amp;nbsp;Q1_2017&amp;nbsp; &amp;nbsp;Q2_2017&amp;nbsp; &amp;nbsp;Q3_2017&amp;nbsp; Q4_2017&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;35&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 45&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 81&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;126&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 17:58:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584694#M14219</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-08-28T17:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose two variables (kind of)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584696#M14220</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
 
data have;

input Site_ID    S1_6_tot    Quarter_Year &amp;amp; $15.;
cards;
1              35               Q1 2017
1              45               Q2 2017
1              81               Q3 2017
1              126             Q4 2017
;


proc transpose data=have out=want(drop=_name_);
by site_id;
var S1_6_tot;
id Quarter_Year;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:01:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584696#M14220</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-28T18:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose two variables (kind of)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584697#M14221</link>
      <description>Seems like a straight forward proc transpose. Use ID and IDLABEL to specify the naming variable.&lt;BR /&gt;You may need to sort first if you have more than one site id. &lt;BR /&gt;&lt;BR /&gt;proc transpose data=have out=want;&lt;BR /&gt;by site_id;&lt;BR /&gt;var s1_6_tot;&lt;BR /&gt;id quarter_year;&lt;BR /&gt;idlabel quarter_year;&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:02:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584697#M14221</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-28T18:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose two variables (kind of)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584699#M14222</link>
      <description>&lt;P&gt;Thank you! Didn't realize I could use an ID statement to call Quarter_Year values.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584699#M14222</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-08-28T18:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose two variables (kind of)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584715#M14225</link>
      <description>&lt;P&gt;Thank you Reeza! This was more straight forward then I thought it would be. Thanks for your input as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 18:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose-two-variables-kind-of/m-p/584715#M14225</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-08-28T18:27:26Z</dc:date>
    </item>
  </channel>
</rss>

