<?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 New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510176#M1894</link>
    <description>&lt;P&gt;Thank for your help!&lt;/P&gt;</description>
    <pubDate>Sat, 03 Nov 2018 15:10:40 GMT</pubDate>
    <dc:creator>ykoba</dc:creator>
    <dc:date>2018-11-03T15:10:40Z</dc:date>
    <item>
      <title>proc transpose</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510118#M1885</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thank you in advance for your help.&lt;/P&gt;&lt;P&gt;I have the following data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;ID date bp time&lt;/P&gt;&lt;P&gt;1 10/2/2018 100 0&lt;/P&gt;&lt;P&gt;1 10/2/2018 90 1&lt;/P&gt;&lt;P&gt;1 9/7/2017 89 0&lt;/P&gt;&lt;P&gt;1 9/7/2017 94 1&lt;/P&gt;&lt;P&gt;1 9/72017 89 2&lt;/P&gt;&lt;P&gt;2 4/4/2016 130 0&lt;/P&gt;&lt;P&gt;2/ 4/4/2016 145 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The expected dataset is as follows,&amp;nbsp;&lt;/P&gt;&lt;P&gt;id date x0 x1 x2&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&lt;SPAN&gt;10/2/2018 100 90&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1&amp;nbsp;9/7/2017 89 94 89&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp;4/4/2016 130 45&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current program is as follows,&lt;/P&gt;&lt;P&gt;&amp;nbsp;proc transpose data=have out=want. prefix=x;&lt;BR /&gt;var bp;&lt;/P&gt;&lt;P&gt;by id date;&lt;BR /&gt;id time;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to transpose bp for each id and date but I could not obtain the expected dataset with this codes.&lt;/P&gt;&lt;P&gt;I have spent a lot of time, but I haven't&amp;nbsp;reached the answer.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 05:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510118#M1885</guid>
      <dc:creator>ykoba</dc:creator>
      <dc:date>2018-11-03T05:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510131#M1887</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/149491"&gt;@ykoba&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With only a few modifications your code works well:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want(drop=_:) prefix=x;
var bp;
by id date notsorted;
id time;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(Note: The "45" for ID 2 in your "expected dataset" should read "145".)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The NOTSORTED option of the BY statement is useful if the input dataset is not sorted by the BY variables, but the BY groups are blocks of consecutive observations.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 10:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510131#M1887</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-03T10:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510132#M1888</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/149491"&gt;@ykoba&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data have;
input ID date mmddyy10. bp: 8. time: 8.;
cards;
1 10/2/2018 100 0
1 10/2/2018 90 1
1 9/7/2017  89 0
1 9/7/2017  94 1
1 9/7/2017  89 2
2 4/4/2016  130 0
2 4/4/2016  145 1
;
 
proc sort data=have;
	by id date;
run;
proc transpose data=have out=want(drop=_name_) prefix=x ;
	id time;
	by id date;
	var bp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the incoming dates were incorrect they needed fixing missing /&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 11:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510132#M1888</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-11-03T11:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510175#M1893</link>
      <description>&lt;P&gt;I appreciate your help and the code works!&lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 15:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510175#M1893</guid>
      <dc:creator>ykoba</dc:creator>
      <dc:date>2018-11-03T15:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc transpose</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510176#M1894</link>
      <description>&lt;P&gt;Thank for your help!&lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 15:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-transpose/m-p/510176#M1894</guid>
      <dc:creator>ykoba</dc:creator>
      <dc:date>2018-11-03T15:10:40Z</dc:date>
    </item>
  </channel>
</rss>

