<?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: Re ordering variables in sas in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90333#M25787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;suppose I am having variables in the order- visit patno pat_initials body_temp1 sbp1 dbp1 pulserate1 body_temp2 sbp2 dbp2 pulserate2&lt;/P&gt;&lt;P&gt;and I want to arrange these variables in the order-patno visit pat_initials body_temp1 body_temp2 sbp1 sbp2 dbp1 dbp2 pulserate1 pulserate2.&lt;/P&gt;&lt;P&gt;It is just an example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2012 08:35:44 GMT</pubDate>
    <dc:creator>kumarnaidu</dc:creator>
    <dc:date>2012-04-20T08:35:44Z</dc:date>
    <item>
      <title>Re ordering variables in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90330#M25784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone tell me how to reorder some variables if I am having large number of variables in my data set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 05:53:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90330#M25784</guid>
      <dc:creator>kumarnaidu</dc:creator>
      <dc:date>2012-04-20T05:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Re ordering variables in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90331#M25785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are lot of threads discussing this issue. Use the search facility to fins them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 06:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90331#M25785</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-04-20T06:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re ordering variables in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90332#M25786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Give us an example, then someone will help you .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 07:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90332#M25786</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-04-20T07:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Re ordering variables in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90333#M25787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;suppose I am having variables in the order- visit patno pat_initials body_temp1 sbp1 dbp1 pulserate1 body_temp2 sbp2 dbp2 pulserate2&lt;/P&gt;&lt;P&gt;and I want to arrange these variables in the order-patno visit pat_initials body_temp1 body_temp2 sbp1 sbp2 dbp1 dbp2 pulserate1 pulserate2.&lt;/P&gt;&lt;P&gt;It is just an example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 08:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90333#M25787</guid>
      <dc:creator>kumarnaidu</dc:creator>
      <dc:date>2012-04-20T08:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Re ordering variables in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90334#M25788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. You can create a format to customize the order of variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
input (visit patno pat_initials body_temp1 sbp1 dbp1 pulserate1 body_temp2 sbp2 dbp2 pulserate2) ($);
cards;
1 2 3 4 5 3 4 5 4 3 2 2 2 2 2 2 2 2 2 2 2 2 2 
;
run;
proc sql;
 select name into : list separated by ' '
&amp;nbsp; from dictionary.columns
&amp;nbsp;&amp;nbsp; where libname='WORK' and memname='HAVE' and name not in ('visit' 'patno' 'pat_initials')
&amp;nbsp;&amp;nbsp;&amp;nbsp; order by scan(name,1,' ','d'),input(scan(name,1,' ' ,'kd'),best32.);
quit;
%put &amp;amp;list;
data want;
 retain patno visit pat_initials &amp;amp;list;
 set have;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 08:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90334#M25788</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-04-20T08:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re ordering variables in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90335#M25789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kumar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use length statement(if you define length for particular column it will come first ,if you don't want to change the order then don't define that variable in length statement) or you can use Column&amp;nbsp; in proc report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 09:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90335#M25789</guid>
      <dc:creator>shivas</dc:creator>
      <dc:date>2012-04-20T09:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Re ordering variables in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90336#M25790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 10:13:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90336#M25790</guid>
      <dc:creator>kumarnaidu</dc:creator>
      <dc:date>2012-04-20T10:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Re ordering variables in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90337#M25791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ... one issue with using LENGTH is making sure that the lengths provided for the variables match those already in the data set that is being reordered.&amp;nbsp; I think that one is safer with the more standard solution that Ksharp proposed, using a RETAIN statement where no attributes of the variables are needed,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 15:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Re-ordering-variables-in-sas/m-p/90337#M25791</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-04-20T15:02:44Z</dc:date>
    </item>
  </channel>
</rss>

