<?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: How to do a kind of transpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-a-kind-of-transpose/m-p/723633#M224577</link>
    <description>&lt;P&gt;You can probably get there by using two PROC TRANSPOSE steps. First to convert your current wide struction into a tall structure.&amp;nbsp; Then a second one to convert it back into the even wider version you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=tall;
  by p;
run;

proc transpose data=tall out=wide(drop=_name_) delim=_;
  id _name_ p ;
  var col1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But why do you think that is going to help you?&lt;/P&gt;
&lt;P&gt;For most purposes the TALL structure is probably better. Or even your original semi-wide structure.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Mar 2021 20:44:11 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-03-04T20:44:11Z</dc:date>
    <item>
      <title>How to do a kind of transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-a-kind-of-transpose/m-p/723622#M224570</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I am a beginner of SAS and need your kind help to find the best way to transpose one table . Any advice will be greatly appreciated.&lt;/P&gt;&lt;P&gt;I have a sample data set as attachment where you can see what i want to do: Thank you very much for your time and help.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ex" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55470i1E5F5912F694B6C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ex_what_i_want_to_do.PNG" alt="Ex" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Ex&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 20:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-a-kind-of-transpose/m-p/723622#M224570</guid>
      <dc:creator>PauloC</dc:creator>
      <dc:date>2021-03-04T20:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a kind of transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-a-kind-of-transpose/m-p/723630#M224575</link>
      <description>&lt;P&gt;First transpose it to a long format and then you can transpose it to a wide format using both old/new and usage of ID and IDLABEL statements. &lt;BR /&gt;&lt;BR /&gt;If you post data as a data step someone can help with the code. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Transposing data tutorials:&lt;BR /&gt;Long to Wide:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/&lt;/A&gt;&lt;BR /&gt;&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;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;And sometimes a double transpose is needed for extra wide data sets: &amp;lt;- this is what you need.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;A href="https://gist.github.com/statgeek/2321b6f62ab78d5bf2b0a5a8626bd7cd" target="_blank"&gt;https://gist.github.com/statgeek/2321b6f62ab78d5bf2b0a5a8626bd7cd&lt;/A&gt;&lt;/STRONG&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/372368"&gt;@PauloC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;I am a beginner of SAS and need your kind help to find the best way to transpose one table . Any advice will be greatly appreciated.&lt;/P&gt;
&lt;P&gt;I have a sample data set as attachment where you can see what i want to do: Thank you very much for your time and help.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ex" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55470i1E5F5912F694B6C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ex_what_i_want_to_do.PNG" alt="Ex" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Ex&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 20:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-a-kind-of-transpose/m-p/723630#M224575</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-04T20:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a kind of transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-a-kind-of-transpose/m-p/723633#M224577</link>
      <description>&lt;P&gt;You can probably get there by using two PROC TRANSPOSE steps. First to convert your current wide struction into a tall structure.&amp;nbsp; Then a second one to convert it back into the even wider version you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=tall;
  by p;
run;

proc transpose data=tall out=wide(drop=_name_) delim=_;
  id _name_ p ;
  var col1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But why do you think that is going to help you?&lt;/P&gt;
&lt;P&gt;For most purposes the TALL structure is probably better. Or even your original semi-wide structure.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 20:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-a-kind-of-transpose/m-p/723633#M224577</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-04T20:44:11Z</dc:date>
    </item>
  </channel>
</rss>

