<?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 transposing to make one record per id. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/transposing-to-make-one-record-per-id/m-p/418187#M102710</link>
    <description>&lt;P&gt;I am stuck up with transposing as i get multople observations if i try to transpose as the paramcd has multiple observations. attached code i am using and i need single observation per subject. any suggestion where am i going wrong&lt;/P&gt;
&lt;PRE&gt;proc sort data=Anl1
	           out= anl2;
     by studyid usubjid paramcd aval;
run;

data Id_adds (keep=studyid usubjid aval avalc paramcd seq);
      set anl2;
      by studyid usubjid paramcd aval;
      seq+1;
       if first.paramcd then seq=1;
run;

proc transpose data=Id_adds out=Id_trans(drop=_name_ _label_) ;
      by studyid usubjid;
     id paramcd seq;
     var aval;
run;
&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 Dec 2017 15:29:58 GMT</pubDate>
    <dc:creator>vraj1</dc:creator>
    <dc:date>2017-12-04T15:29:58Z</dc:date>
    <item>
      <title>transposing to make one record per id.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-to-make-one-record-per-id/m-p/418187#M102710</link>
      <description>&lt;P&gt;I am stuck up with transposing as i get multople observations if i try to transpose as the paramcd has multiple observations. attached code i am using and i need single observation per subject. any suggestion where am i going wrong&lt;/P&gt;
&lt;PRE&gt;proc sort data=Anl1
	           out= anl2;
     by studyid usubjid paramcd aval;
run;

data Id_adds (keep=studyid usubjid aval avalc paramcd seq);
      set anl2;
      by studyid usubjid paramcd aval;
      seq+1;
       if first.paramcd then seq=1;
run;

proc transpose data=Id_adds out=Id_trans(drop=_name_ _label_) ;
      by studyid usubjid;
     id paramcd seq;
     var aval;
run;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Dec 2017 15:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-to-make-one-record-per-id/m-p/418187#M102710</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-12-04T15:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: transposing to make one record per id.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/transposing-to-make-one-record-per-id/m-p/418194#M102714</link>
      <description>&lt;P&gt;This:&lt;/P&gt;
&lt;PRE&gt;     id paramcd seq;
&lt;/PRE&gt;
&lt;P&gt;Wont work.&amp;nbsp; &amp;nbsp;Update here:&lt;/P&gt;
&lt;PRE&gt;data Id_adds (keep=studyid usubjid aval avalc paramcd seq);
  set anl2;
  by studyid usubjid paramcd aval;&lt;BR /&gt;  retain seq;
  if first.paramcd then seq=1; &lt;BR /&gt;  else seq+1;&lt;BR /&gt;  paramcd=cats(paramcd,put(seq,best.));
run;&lt;/PRE&gt;
&lt;P&gt;Then put:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc transpose data=Id_adds out=Id_trans(drop=_name_ _label_) ;
  by studyid usubjid;
  id paramcd;
  var aval;
run;&lt;/PRE&gt;
&lt;P&gt;Ie make the variable paramcd cd unique by adding the incremental number to it (when you have the sequence correct).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 15:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/transposing-to-make-one-record-per-id/m-p/418194#M102714</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-04T15:45:05Z</dc:date>
    </item>
  </channel>
</rss>

