<?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: Another Proc_Transpose Question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121006#M33366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming your data is sorted I'd probably go with a datastep. The link below is a good instruction. If you really want proc transpose that link is further below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/modules/widetolong_data.htm" title="http://www.ats.ucla.edu/stat/sas/modules/widetolong_data.htm"&gt;SAS Learning Module: Reshaping wide to long using a data step&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the vname function to capture the name of the array variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;do i = 1 to dim(month_vars);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=month_vars(i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; month=vname(month_vars(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm" title="http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm"&gt;SAS Learning Module: How to reshape data wide to long using proc transpose&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trick is to keep all the variables you want in your BY statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Aug 2013 20:02:16 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-08-23T20:02:16Z</dc:date>
    <item>
      <title>Another Proc_Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121005#M33365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to SAS and my skills are still abysmal at best. I am trying to work my way through Proc Transpose and I see frequent postings on it here in the forum. I was hoping someone could help walk me through my task so I better understand the Proc Transpose procedure. My data set that I am working with is as shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Untitled.jpg" class="jive-image-thumbnail jive-image" height="153" src="https://communities.sas.com/legacyfs/online/4074_Untitled.jpg" width="747" /&gt;&lt;/P&gt;&lt;P&gt;Just observing the highlighted record, I am trying to transpose the Month_YY columns by each Key variable. The 0's represent the payment for each month of that key and I want the months in a single column with each paymnet in the next column, all while keeping the rest of the record constant. I have an example below of what I am trying to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image-thumbnail jive-image" height="152" src="https://communities.sas.com/legacyfs/online/4076_Capture.JPG" width="751" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 19:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121005#M33365</guid>
      <dc:creator>MalcolmCICWF</dc:creator>
      <dc:date>2013-08-23T19:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Another Proc_Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121006#M33366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming your data is sorted I'd probably go with a datastep. The link below is a good instruction. If you really want proc transpose that link is further below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/modules/widetolong_data.htm" title="http://www.ats.ucla.edu/stat/sas/modules/widetolong_data.htm"&gt;SAS Learning Module: Reshaping wide to long using a data step&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the vname function to capture the name of the array variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;do i = 1 to dim(month_vars);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value=month_vars(i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; month=vname(month_vars(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm" title="http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm"&gt;SAS Learning Module: How to reshape data wide to long using proc transpose&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trick is to keep all the variables you want in your BY statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 20:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121006#M33366</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-08-23T20:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Another Proc_Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121007#M33367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data I have in my first example is already from a proc import of a csv file spit out form another sas job, so that is the format and structure I have to work with. I read that document and cannot get it to apply correctly to what I am working on. I was hoping someone could supply me some code to help me achieve my goal. I would be able to understand what it is doing much better I had an example of the code that provided my results. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 20:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121007#M33367</guid>
      <dc:creator>MalcolmCICWF</dc:creator>
      <dc:date>2013-08-23T20:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Another Proc_Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121008#M33368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc transpose ;&lt;/P&gt;&lt;P&gt; by facevalue proceeds poolstart key portfpool trantype ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable _NAME_ will have the former variable names.&lt;/P&gt;&lt;P&gt;The variable COL1 will have the values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 20:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121008#M33368</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-08-23T20:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Another Proc_Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121009#M33369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a side piece of advice.&amp;nbsp; There are many more important areas to start learning SAS than PROC TRANSPOSE.&amp;nbsp; Just to name a few, study these statements within a DATA step (what they do, when they can be used):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RETAIN&lt;/P&gt;&lt;P&gt;BY&lt;/P&gt;&lt;P&gt;value + amount;&lt;/P&gt;&lt;P&gt;LENGTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The list could be longer, but each of these will likely prove more valuable to you than learning PROC TRANSPOSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 20:22:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121009#M33369</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-08-23T20:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Another Proc_Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121010#M33370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once you get the data transposed as per Tom's suggestion you will want to read the _NAME_ field using a date informat so you can convert the month and year to SASDate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 20:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121010#M33370</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-08-23T20:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Another Proc_Transpose Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121011#M33371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom, adding all my variables to be sorted and in the order I need them was the piece I was missing in all of this. I was only using a single variable to sort by which was throwing all my data off. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 20:36:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-Proc-Transpose-Question/m-p/121011#M33371</guid>
      <dc:creator>MalcolmCICWF</dc:creator>
      <dc:date>2013-08-23T20:36:37Z</dc:date>
    </item>
  </channel>
</rss>

