<?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 on multiple columns? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38713#M9961</link>
    <description>Sorry, I wasn't aware there is already a topic about untranspose. And the website you provided, I don't think they provide anything for free. Thanks for the help.</description>
    <pubDate>Fri, 29 May 2009 19:04:14 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-05-29T19:04:14Z</dc:date>
    <item>
      <title>PROC transpose on multiple columns?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38707#M9955</link>
      <description>I know how PROC transpose works on a single column. But when you have 10 columns, how do you transpose them?&lt;BR /&gt;
&lt;BR /&gt;
I have a data set like the following:&lt;BR /&gt;
&lt;BR /&gt;
ID date1 date2 date3 date4 date5 rec1 rec2 rec3 rec4 rec5&lt;BR /&gt;
&lt;BR /&gt;
I need to create a data set like this:&lt;BR /&gt;
&lt;BR /&gt;
ID date rec&lt;BR /&gt;
&lt;BR /&gt;
So, in the original data set, I have everything for ID 1 in one row, and everything for ID 2 in one row...I need to change to a data set that there are 5 rows for each ID. So for ID 1, I will have 5 rows with ID 1 repeating 5 times. How do you do this?&lt;BR /&gt;
&lt;BR /&gt;
Or can I do it the hard way? Instead of trying to create a data set directly from the old data set, I can break down the old data set into 5 different data set and then use set to combine them back together. Will this work?&lt;BR /&gt;
&lt;BR /&gt;
For example:&lt;BR /&gt;
&lt;BR /&gt;
Creating data set 1:&lt;BR /&gt;
data set1;&lt;BR /&gt;
  set old;&lt;BR /&gt;
  keep ID date1 rec1;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Then I rename date1 and rec1 to date and rec and I will do this for date2-date5 and rec2-rec5. Then at the end, I can just combine them using a set statement like:&lt;BR /&gt;
&lt;BR /&gt;
data new;&lt;BR /&gt;
  set set1 set2 set3 set4 set5;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Will this work? In theory.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
thanks

Message was edited by: cosmid</description>
      <pubDate>Fri, 29 May 2009 14:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38707#M9955</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T14:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: PROC transpose on multiple columns?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38708#M9956</link>
      <description>This topic has been discussed on the SAS forums.  Recommend a forum search for untranspose.  Also, you should find information at the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  where you will want to focus on Data Step programming and using ARRAYs with a DO / END loop to take your horizontal (one observation, multiple analysis variables) data and make it vertical (one observation per analysis variable set, along with some set of key variables). &lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 29 May 2009 15:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38708#M9956</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-29T15:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC transpose on multiple columns?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38709#M9957</link>
      <description>This is a test reply - please ignore.  Forum back-end server appears to be sick or maybe not.</description>
      <pubDate>Fri, 29 May 2009 15:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38709#M9957</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-29T15:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC transpose on multiple columns?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38710#M9958</link>
      <description>One way of doing this through Proc Transpose each set of variables and merge together. See the below code. Let me know if it doen't work.&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=test;&lt;BR /&gt;
  by id;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc transpose data=test out=test1(rename=(col1=dat));&lt;BR /&gt;
  by id;&lt;BR /&gt;
  var dat1-dat5;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc transpose data=test out=test2(rename=(col1=rec));&lt;BR /&gt;
  by id;&lt;BR /&gt;
  var rec1-rec5;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data test3 (drop=_name_);&lt;BR /&gt;
   merge test1 test2;&lt;BR /&gt;
   by id;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
~ Sukanya E</description>
      <pubDate>Fri, 29 May 2009 17:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38710#M9958</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T17:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: PROC transpose on multiple columns?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38711#M9959</link>
      <description>First time when I tried was using multiple proc transpose and then tried to merge the data back together. I don't remember what it did wrong but it didn't work out right. The method I listed above actually worked. Using multiple sets. I will try the multiple proc transpose again later and let you know if it works.</description>
      <pubDate>Fri, 29 May 2009 18:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38711#M9959</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T18:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC transpose on multiple columns?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38712#M9960</link>
      <description>Multiple proc transpose works. I remember now. I just went through the data that I created before using multiple proc transpose. I think the multiple sets I posted earlier actually works better. You get more control over each variable compared to using multiple proc transpose.</description>
      <pubDate>Fri, 29 May 2009 19:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38712#M9960</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T19:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: PROC transpose on multiple columns?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38713#M9961</link>
      <description>Sorry, I wasn't aware there is already a topic about untranspose. And the website you provided, I don't think they provide anything for free. Thanks for the help.</description>
      <pubDate>Fri, 29 May 2009 19:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38713#M9961</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T19:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC transpose on multiple columns?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38714#M9962</link>
      <description>Sorry for any confusion.  &lt;BR /&gt;
&lt;BR /&gt;
My suggestion was to search the SAS Discussion Forums using the term "untranspose" - and you would find this post:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=17509" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=17509&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 29 May 2009 19:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-transpose-on-multiple-columns/m-p/38714#M9962</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-29T19:11:36Z</dc:date>
    </item>
  </channel>
</rss>

