<?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: Issues With Proc Transpose in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Issues-With-Proc-Transpose/m-p/123092#M25251</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much, PG.&amp;nbsp; I'll investigate as per your suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Jun 2013 02:32:40 GMT</pubDate>
    <dc:creator>shellp55</dc:creator>
    <dc:date>2013-06-30T02:32:40Z</dc:date>
    <item>
      <title>Issues With Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issues-With-Proc-Transpose/m-p/123090#M25249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using BASE SAS 9.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hospitals all submit their data to a central location so there are strict file specs.&amp;nbsp; One row of data is one hospital visit so the diagnosis information is in wide format.&amp;nbsp;&amp;nbsp; I created a program to extract data from this submission text file and then from that created a program to transpose the diagnosis information in long format. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For one hospital, it worked out great and I was able to transpose the different diagnosis data elements and merge to create a table.&amp;nbsp; Everything worked great.&amp;nbsp; Then I tried with a second hospital and the main table (the one with all data in wide format with one row per patient record) was successfully produced exactly the same way.&amp;nbsp; However, when I used the same transpose code, I got a COL2 added to each transpose step.&amp;nbsp; Can someone explain what causes that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is an excerpt of code and dataset dx1 has COL2 added to it.&amp;nbsp; Some of the entries in COL2 mirror the column now called Diagnosis but not in all circumstances.&amp;nbsp; I realize I can just remove it from each data set as a drop = so that all fields merge correctly but I want to find out what this is happening.&amp;nbsp; All assistance greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*sort file */&lt;/P&gt;&lt;P&gt;proc sort data=diagnosesA out=diagnosesB;&lt;/P&gt;&lt;P&gt;by inst acctno chartno disdate;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*transpose the dx code */&lt;/P&gt;&lt;P&gt;proc transpose data=diagnosesB out=dx2(rename=col1=Diagnosis); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by inst acctno chartno disdate;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; var diagcde1-diagcde25; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jun 2013 00:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issues-With-Proc-Transpose/m-p/123090#M25249</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2013-06-30T00:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Issues With Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issues-With-Proc-Transpose/m-p/123091#M25250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The appearance of COL2 in your transposed table means that there are two records for at least one combination of&amp;nbsp; (inst acctno chartno disdate) in diagnosesB. The 2 records x 25 variables block of data is transposed into a 25x2 block. The problem likely originates before the proc sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jun 2013 01:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issues-With-Proc-Transpose/m-p/123091#M25250</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-06-30T01:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Issues With Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issues-With-Proc-Transpose/m-p/123092#M25251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much, PG.&amp;nbsp; I'll investigate as per your suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jun 2013 02:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issues-With-Proc-Transpose/m-p/123092#M25251</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2013-06-30T02:32:40Z</dc:date>
    </item>
  </channel>
</rss>

