<?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 Transposing data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Transposing-data/m-p/645404#M78524</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I have data like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ID&amp;nbsp; &amp;nbsp;V1&amp;nbsp; V2&amp;nbsp; V3&amp;nbsp; ...... V20&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;01&amp;nbsp; &amp;nbsp;A1&amp;nbsp; B2&amp;nbsp; C3&amp;nbsp; ......&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; O1&amp;nbsp; P2&amp;nbsp; Q3&amp;nbsp; ......&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; X1&amp;nbsp; Y2&amp;nbsp; Z3&amp;nbsp; ......&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;and need to convert it into something like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ID&amp;nbsp; TheVar&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;01&amp;nbsp; A1&lt;/P&gt;
&lt;P&gt;01&amp;nbsp; B2&lt;/P&gt;
&lt;P&gt;01&amp;nbsp; C3&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; O1&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; P2&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; Q3&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; X1&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; Y2&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; Z3&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there an efficient way to do that?&amp;nbsp; Thank you!&lt;/P&gt;
&lt;P&gt;Jason&lt;/P&gt;</description>
    <pubDate>Tue, 05 May 2020 20:19:51 GMT</pubDate>
    <dc:creator>JasonL</dc:creator>
    <dc:date>2020-05-05T20:19:51Z</dc:date>
    <item>
      <title>Transposing data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transposing-data/m-p/645404#M78524</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I have data like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ID&amp;nbsp; &amp;nbsp;V1&amp;nbsp; V2&amp;nbsp; V3&amp;nbsp; ...... V20&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;01&amp;nbsp; &amp;nbsp;A1&amp;nbsp; B2&amp;nbsp; C3&amp;nbsp; ......&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; O1&amp;nbsp; P2&amp;nbsp; Q3&amp;nbsp; ......&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; X1&amp;nbsp; Y2&amp;nbsp; Z3&amp;nbsp; ......&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;and need to convert it into something like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ID&amp;nbsp; TheVar&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;01&amp;nbsp; A1&lt;/P&gt;
&lt;P&gt;01&amp;nbsp; B2&lt;/P&gt;
&lt;P&gt;01&amp;nbsp; C3&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; O1&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; P2&lt;/P&gt;
&lt;P&gt;02&amp;nbsp; Q3&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; X1&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; Y2&lt;/P&gt;
&lt;P&gt;03&amp;nbsp; Z3&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there an efficient way to do that?&amp;nbsp; Thank you!&lt;/P&gt;
&lt;P&gt;Jason&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 20:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transposing-data/m-p/645404#M78524</guid>
      <dc:creator>JasonL</dc:creator>
      <dc:date>2020-05-05T20:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transposing-data/m-p/645409#M78525</link>
      <description>&lt;P&gt;Proc transpose:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
input iD $   V1 $ v2 $  V3 $;
datalines;
01   A1  B2  C3 
02  O1  P2  Q3  
03  X1  Y2  Z3  
;

proc transpose data=have out=trans (drop=_name_)
  prefix=TheVar
;
by id;
var v1 - v3;
run;&lt;/PRE&gt;
&lt;P&gt;If there are other variables that need to be carried along you need to show a better example.&lt;/P&gt;
&lt;P&gt;Please provide data in the form of a data step as shown above and post into a code box opened on the forum using the &amp;lt;/&amp;gt; or "running man" icon. Posting the main message window will usually result in text being reformatted and data steps may not run after the forum gets through with them.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 20:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transposing-data/m-p/645409#M78525</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-05T20:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Transposing-data/m-p/645412#M78526</link>
      <description>&lt;P&gt;Great!&amp;nbsp; That does it!&lt;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 20:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Transposing-data/m-p/645412#M78526</guid>
      <dc:creator>JasonL</dc:creator>
      <dc:date>2020-05-05T20:37:05Z</dc:date>
    </item>
  </channel>
</rss>

