<?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 wide to long in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-wide-to-long/m-p/277678#M55778</link>
    <description>&lt;P&gt;Proc Transpose doesn't have a mechanism to transpose by OBS when there is no obs unique ID. It is simpler to do the transpose explicitly in a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data TBI_transposed;
set TBI_temp;
array d  Diagnosis_1-Diagnosis_10;
do i = 1 to dim(d);
	Diagnosis = d{i};
	output;
	end;
keep Person_ID Encounter_Date Diagnosis;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:53:35 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-06-15T20:53:35Z</dc:date>
    <item>
      <title>Proc Transpose wide to long</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-wide-to-long/m-p/277665#M55777</link>
      <description>&lt;P&gt;I'm trying to transpose a table using the code below. The problem is that a person can have multiple encounters on the same day.&amp;nbsp;The output from the code below&amp;nbsp;puts same-day info into&amp;nbsp;separate columns. Is there some trick to getting SAS to stack all the &lt;FONT face="Courier New" size="2"&gt;Diagnosis_1-Diagnosis_10 info into a single column?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;transpose&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=TBI_temp &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=TBI_transposed&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp; by&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; Person_ID Encounter_Date;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp; var&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; Diagnosis_1-Diagnosis_10 ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Brian&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-wide-to-long/m-p/277665#M55777</guid>
      <dc:creator>BTAinRVA</dc:creator>
      <dc:date>2016-06-15T20:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose wide to long</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-wide-to-long/m-p/277678#M55778</link>
      <description>&lt;P&gt;Proc Transpose doesn't have a mechanism to transpose by OBS when there is no obs unique ID. It is simpler to do the transpose explicitly in a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data TBI_transposed;
set TBI_temp;
array d  Diagnosis_1-Diagnosis_10;
do i = 1 to dim(d);
	Diagnosis = d{i};
	output;
	end;
keep Person_ID Encounter_Date Diagnosis;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-wide-to-long/m-p/277678#M55778</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-06-15T20:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose wide to long</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-wide-to-long/m-p/277688#M55779</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Transpose-wide-to-long/m-p/277688#M55779</guid>
      <dc:creator>BTAinRVA</dc:creator>
      <dc:date>2016-06-15T21:20:06Z</dc:date>
    </item>
  </channel>
</rss>

