<?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 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose/m-p/55629#M15517</link>
    <description>Thanks for your solution.</description>
    <pubDate>Mon, 20 Jul 2009 09:14:56 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-07-20T09:14:56Z</dc:date>
    <item>
      <title>Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose/m-p/55627#M15515</link>
      <description>I have a wide data set of hospital lab test results. The data contains ID, hospital admit date, lab results date, name of the test and result (character).&lt;BR /&gt;
&lt;BR /&gt;
I have a routine that cleans the data and creates a numeric value for each test; if the data is invalid, a missing value is generated.&lt;BR /&gt;
&lt;BR /&gt;
What I need Proc Transpose (or some other routine) to do is create a new record for each test. The problem I am having is I want the character and numeric test result on the same row for that test.&lt;BR /&gt;
&lt;BR /&gt;
For example, if I have a test name for glucose, I will have a character glucose result and a numeric glucose result (char value = -40, numeric value = .)&lt;BR /&gt;
&lt;BR /&gt;
The row would contain ID, hospital admit date, lab results date, glucose_char and glucose (numeric value). Next row would contain ID, hospital admit date, lab results date, wbc_char and wbc(numeric value). &lt;BR /&gt;
&lt;BR /&gt;
How can I do this in Proc Transpose or some other way?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help.&lt;BR /&gt;
Dave</description>
      <pubDate>Fri, 17 Jul 2009 11:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose/m-p/55627#M15515</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-17T11:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose/m-p/55628#M15516</link>
      <description>You don't want to transpose as all your column data remains in columns.&lt;BR /&gt;
&lt;BR /&gt;
You want multiple output rows per input row. This can be done by using several output statements in a data step;&lt;BR /&gt;
[pre]&lt;BR /&gt;
data IN;&lt;BR /&gt;
 ID='1'; hospital='a'; admit_date='01jan2000'd;  lab_date='01jan2000'd; &lt;BR /&gt;
 TEST1='gluc'; RESULTC1='-40';RESULTN1=2;&lt;BR /&gt;
 TEST2='chol'; RESULTC2='208';RESULTN2=45;&lt;BR /&gt;
 TEST3='urea'; RESULTC3='4';  RESULTN3=415;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data OUT;&lt;BR /&gt;
  length TEST RESULTC $20 RESULTN 8;&lt;BR /&gt;
  drop  TEST1 RESULTC1 RESULTN1&lt;BR /&gt;
        TEST2 RESULTC2 RESULTN2&lt;BR /&gt;
        TEST3 RESULTC3 RESULTN3;&lt;BR /&gt;
  set IN;&lt;BR /&gt;
  TEST=TEST1;  RESULTC=RESULTC1; RESULTN=RESULTN1; &lt;B&gt;output;&lt;/B&gt;&lt;BR /&gt;
  TEST=TEST2;  RESULTC=RESULTC2; RESULTN=RESULTN2; &lt;B&gt;output;&lt;/B&gt;&lt;BR /&gt;
  TEST=TEST3;  RESULTC=RESULTC3; RESULTN=RESULTN3; &lt;B&gt;output;&lt;/B&gt;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 20 Jul 2009 04:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose/m-p/55628#M15516</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-07-20T04:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose/m-p/55629#M15517</link>
      <description>Thanks for your solution.</description>
      <pubDate>Mon, 20 Jul 2009 09:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose/m-p/55629#M15517</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-20T09:14:56Z</dc:date>
    </item>
  </channel>
</rss>

