<?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 a DataSet by a UNIQUE Variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Transpose-a-DataSet-by-a-UNIQUE-Variable/m-p/502441#M134123</link>
    <description>&lt;P&gt;Thanks...worked perfect&lt;/P&gt;</description>
    <pubDate>Mon, 08 Oct 2018 16:04:51 GMT</pubDate>
    <dc:creator>SNG1</dc:creator>
    <dc:date>2018-10-08T16:04:51Z</dc:date>
    <item>
      <title>Transpose a DataSet by a UNIQUE Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-a-DataSet-by-a-UNIQUE-Variable/m-p/502048#M133964</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23828i11905574619AB79B/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS.jpg" alt="SAS.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am bit new to SAS, I searched the boards but could not find an answer to the dilemma I am facing -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a SAS Data Set that looks like the attached picture, as you can see that Once address could have multiple phone numbers and/or multiple First Name. I am trying to transpose this data do I can see it something like this (as headings and then the data underneath)&amp;nbsp;-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Address&amp;nbsp; &amp;nbsp; First Name1&amp;nbsp;&amp;nbsp;&amp;nbsp; First Name2&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstName...n&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone1&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone4&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone...n&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Example for&amp;nbsp; first two records, I would like to see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 52 2 Niagara&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Menzies Justin&amp;nbsp;&amp;nbsp;&amp;nbsp; Menzies Justin&amp;nbsp;&amp;nbsp;&amp;nbsp; 5198450640&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5198451608&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if there are multiple names or phone numbers then a extra column gets added for each...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much appreciated....Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 21:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-a-DataSet-by-a-UNIQUE-Variable/m-p/502048#M133964</guid>
      <dc:creator>SNG1</dc:creator>
      <dc:date>2018-10-05T21:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose a DataSet by a UNIQUE Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-a-DataSet-by-a-UNIQUE-Variable/m-p/502052#M133965</link>
      <description>&lt;P&gt;You're transposing multiple varialbes so you'll need to eitehr:&lt;/P&gt;
&lt;P&gt;1. Use an ARRAY()&amp;nbsp;&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;/P&gt;
&lt;P&gt;2. Use multiple PROC TRANSPOSE and merge the results.&amp;nbsp;&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The latter is usually easier if you're a beginner.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's a macro called 'A Better Way to Flip" and you can use that to get what you want as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/A_Better_Way_to_Flip_(Transpose)_a_SAS_Dataset" target="_blank"&gt;http://www.sascommunity.org/wiki/A_Better_Way_to_Flip_(Transpose)_a_SAS_Dataset&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/238046"&gt;@SNG1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23828i11905574619AB79B/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS.jpg" alt="SAS.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am bit new to SAS, I searched the boards but could not find an answer to the dilemma I am facing -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a SAS Data Set that looks like the attached picture, as you can see that Once address could have multiple phone numbers and/or multiple First Name. I am trying to transpose this data do I can see it something like this (as headings and then the data underneath)&amp;nbsp;-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Address&amp;nbsp; &amp;nbsp; First Name1&amp;nbsp;&amp;nbsp;&amp;nbsp; First Name2&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstName...n&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone1&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone4&amp;nbsp;&amp;nbsp;&amp;nbsp; Phone...n&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Example for&amp;nbsp; first two records, I would like to see:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 52 2 Niagara&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Menzies Justin&amp;nbsp;&amp;nbsp;&amp;nbsp; Menzies Justin&amp;nbsp;&amp;nbsp;&amp;nbsp; 5198450640&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5198451608&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if there are multiple names or phone numbers then a extra column gets added for each...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is much appreciated....Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 21:24:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-a-DataSet-by-a-UNIQUE-Variable/m-p/502052#M133965</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-05T21:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose a DataSet by a UNIQUE Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Transpose-a-DataSet-by-a-UNIQUE-Variable/m-p/502441#M134123</link>
      <description>&lt;P&gt;Thanks...worked perfect&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 16:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Transpose-a-DataSet-by-a-UNIQUE-Variable/m-p/502441#M134123</guid>
      <dc:creator>SNG1</dc:creator>
      <dc:date>2018-10-08T16:04:51Z</dc:date>
    </item>
  </channel>
</rss>

