<?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 how to use array or proc sql to replace proc transpose to my below code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403100#M97939</link>
    <description>&lt;P&gt;Below is the code which i am using but i want to replace proc tranpose with either proc sql or arrays as i need to sort avalc with aval to sort as per aval.&lt;/P&gt;
&lt;PRE&gt;	proc sort data=Anl1
	           out=anl2;
	   by subjid paramcd aval;
	run;

	data Id_adds (keep=subjid aval avalc paramcd seq);
	    set anl2;
	     by subjid paramcd aval;
	       seq+1;
	     if first.paramcd then seq=1;
	run;
	proc transpose data=Id_adds out=Id_trans(drop=_name_ _label_) ;
	     by subjid;
	     id paramcd seq;
	     var avalc;
	run;&lt;/PRE&gt;
&lt;P&gt;any help?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Oct 2017 11:39:30 GMT</pubDate>
    <dc:creator>vraj1</dc:creator>
    <dc:date>2017-10-11T11:39:30Z</dc:date>
    <item>
      <title>how to use array or proc sql to replace proc transpose to my below code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403100#M97939</link>
      <description>&lt;P&gt;Below is the code which i am using but i want to replace proc tranpose with either proc sql or arrays as i need to sort avalc with aval to sort as per aval.&lt;/P&gt;
&lt;PRE&gt;	proc sort data=Anl1
	           out=anl2;
	   by subjid paramcd aval;
	run;

	data Id_adds (keep=subjid aval avalc paramcd seq);
	    set anl2;
	     by subjid paramcd aval;
	       seq+1;
	     if first.paramcd then seq=1;
	run;
	proc transpose data=Id_adds out=Id_trans(drop=_name_ _label_) ;
	     by subjid;
	     id paramcd seq;
	     var avalc;
	run;&lt;/PRE&gt;
&lt;P&gt;any help?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403100#M97939</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-10-11T11:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to use array or proc sql to replace proc transpose to my below code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403104#M97940</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/62004"&gt;@vraj1&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;"&lt;EM&gt;..&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;as i need to sort avalc with aval to sort as per aval...&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Maybe above will make sense to someone; it doesn't to me.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As for alternatives to Proc Transpose the following should be a quite good starting point:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/A_Better_Way_to_Flip_(Transpose)_a_SAS_Dataset" target="_blank"&gt;http://www.sascommunity.org/wiki/A_Better_Way_to_Flip_(Transpose)_a_SAS_Dataset&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:49:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403104#M97940</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-11T11:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to use array or proc sql to replace proc transpose to my below code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403107#M97942</link>
      <description>&lt;P&gt;i mean to say is sorting of avalc should be based on aval and i cannot use that in by statement in proc transpose&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403107#M97942</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-10-11T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to use array or proc sql to replace proc transpose to my below code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403108#M97943</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/62004"&gt;@vraj1&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;If you want help in the form of code then you need to provide sample data (a working SAS datastep creating such data) and then show us the desired result based on the sample data.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 11:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403108#M97943</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-11T11:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to use array or proc sql to replace proc transpose to my below code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403117#M97945</link>
      <description>&lt;P&gt;attached dataset. if you run my code it gives result but only thing i need is avalc in sorted order and if i include aval in by group in proc transpose it gives a wrong result&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403117#M97945</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2017-10-11T12:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to use array or proc sql to replace proc transpose to my below code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403120#M97946</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/62004"&gt;@vraj1&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Please provide a sample/show us how the desired output should look like. This might be very obvious to you but it's not to me and I don't want to spend time and effort on something which doesn't return what you're after.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403120#M97946</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-11T12:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to use array or proc sql to replace proc transpose to my below code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403128#M97949</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/62004"&gt;@vraj1&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Looking at&amp;nbsp;the data and code you've now provided again: May be below gives you what you're after.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=Id_adds out=Id_trans(drop=_:);
  by subjid;
  id paramcd seq;
  var avalc;
run;

proc sql;
  create table want as
    select 
      idt.*,
      l.aval
    from 
      id_trans as idt
      left join
      (select subjid, aval, avalc from anl2) as l
      on idt.subjid=l.subjid
    order by l.aval, idt.subjid
    ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Oct 2017 12:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-array-or-proc-sql-to-replace-proc-transpose-to-my/m-p/403128#M97949</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-11T12:39:52Z</dc:date>
    </item>
  </channel>
</rss>

