<?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: Change Variable order in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91685#M19360</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input a b c;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input b c a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;4 5 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table c as&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from have1&lt;/P&gt;&lt;P&gt;where 0&lt;/P&gt;&lt;P&gt;union&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from have2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Dec 2012 09:23:42 GMT</pubDate>
    <dc:creator>RD2</dc:creator>
    <dc:date>2012-12-06T09:23:42Z</dc:date>
    <item>
      <title>Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91676#M19351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a dataset in which I want the vars to appear in a predetermined order. The correct order is contained in another dataset. How can I transfer one to the other?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 19:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91676#M19351</guid>
      <dc:creator>Doug</dc:creator>
      <dc:date>2012-12-05T19:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91677#M19352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly is the data that is "contained in another dataset"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 19:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91677#M19352</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-12-05T19:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91678#M19353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to invoke PROC SQL twice, but you can capture the order in the other dataset by referring to values in the dictionary.columns dataset that is (quietly) available to you in PROC SQL. First you load the ordered columns into a macro variable (separated by commas). Then you go back and create a reordered dataset using the macro variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name into: variable_order separated by ','&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dictionary.columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; libname = 'WORK' and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memname = 'OTHER_DATASET';&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put variable_order= &amp;amp;variable_order;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; create table THIS_DATASET_REORDERED as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;variable_order&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS_DATASET;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 19:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91678#M19353</guid>
      <dc:creator>tish</dc:creator>
      <dc:date>2012-12-05T19:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91679#M19354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In dictionary.columns, the libname and memname variables are all upper case.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 19:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91679#M19354</guid>
      <dc:creator>tish</dc:creator>
      <dc:date>2012-12-05T19:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91680#M19355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens is I have some character variables which are very long &amp;gt;200. If they meet this criterion, they are renamed and split into 200 character maximum fields. The original field is then removed. The issue arises when the new vars are placed last in the dataset since they were created last. So, in essence the datasets have the same data with the long fields broken into smaller parts. I want the split fields to appear where the original long variable appeared in the original dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 19:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91680#M19355</guid>
      <dc:creator>Doug</dc:creator>
      <dc:date>2012-12-05T19:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91681#M19356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have a standard pattern for renaming the variables? Again, create the macro variable using the dictionary.columns file and then reprocess it in a macro, substituting the new names for the old ones. Go back into SQL to create a table with the new order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 19:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91681#M19356</guid>
      <dc:creator>tish</dc:creator>
      <dc:date>2012-12-05T19:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91682#M19357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you say 200, is it the length of variable (content) or the length of variable name?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 20:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91682#M19357</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-12-05T20:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91683#M19358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Length of the content 200+ characters&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 20:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91683#M19358</guid>
      <dc:creator>Doug</dc:creator>
      <dc:date>2012-12-05T20:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91684#M19359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have *not* tested the following and there could be a syntax error or two. There could also be a faster way to do it. Please note that you can look at the dictionary.columns table: use the SAS explorer to open up the sashelp library. Scroll down to the Vcolumn icon and open that up: it's the same file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***** grab information from the dictionary.columns table and put it into two macro variables now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name into: variable_order separated by ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dictionary.columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; libname = 'WORK' and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memname = 'OTHER_DATASET';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name into: long_ones separated by " "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dictionary.columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; libname = 'WORK' and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memname = 'OTHER_DATASET' and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type = "char" and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length &amp;gt;= 200;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put variable_order= &amp;amp;variable_order;&lt;/P&gt;&lt;P&gt;%put long_ones= &amp;amp;long_ones;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***** Use a macro to read the two lists and create a third one, this time comma separated:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%MACRO create_new_list;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %global new_order;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %let start = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %let new_order=;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %do&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l = 1 %to %sysfunc(countw(&amp;amp;long_ones));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let long_one = %scan(&amp;amp;long_ones, &amp;amp;l);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = &amp;amp;start %to %sysfunc(countw(&amp;amp;variable_order));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let variable = %scan(&amp;amp;variable_order, &amp;amp;i);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;variable ^= &amp;amp;long_one %then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let new_order = &amp;amp;new_order.,&amp;amp;variable;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let new_order = &amp;amp;new_order.,&amp;amp;variable._1,&amp;amp;variable._2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let start = %eval(&amp;amp;i + 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %goto out:;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %out:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%MEND create_new_list;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put new_order= &amp;amp;new_order;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***** Use the new variable to order the dataset in PROC SQL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; create table THIS_DATASET_REORDERED as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;new_order&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THIS_DATASET;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional comment: this macro still needs to add any variables that appear after the last long variable. I could keep playing with it, but I can't tell if you're interested.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 22:29:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91684#M19359</guid>
      <dc:creator>tish</dc:creator>
      <dc:date>2012-12-05T22:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91685#M19360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input a b c;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input b c a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;4 5 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table c as&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from have1&lt;/P&gt;&lt;P&gt;where 0&lt;/P&gt;&lt;P&gt;union&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from have2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 09:23:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91685#M19360</guid>
      <dc:creator>RD2</dc:creator>
      <dc:date>2012-12-06T09:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91686#M19361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To try to answer your original question, have you tried this?...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data out;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set ordered (obs=0);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you include the ordered dataset as the first in the set statement, but with obs=0, it should define the variables you want in the order you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 10:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91686#M19361</guid>
      <dc:creator>TimArm</dc:creator>
      <dc:date>2012-12-06T10:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91687#M19362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table temp like OTHER_DATASET;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc append base=temp data=THIS_DATASET;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 14:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91687#M19362</guid>
      <dc:creator>tacit</dc:creator>
      <dc:date>2012-12-06T14:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91688#M19363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to complete this:&lt;/P&gt;&lt;P&gt;data out;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set ordered (obs=0) unordered;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But: it works only correct, if variables in ordered have the same attributes as those in unordered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 09:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91688#M19363</guid>
      <dc:creator>HWSteinberg</dc:creator>
      <dc:date>2012-12-10T09:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Change Variable order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91689#M19364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! What I eneded up doing was using the chalk board to write the repeated dataset and retain statements. It took a while but it seems to work well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 14:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-Variable-order/m-p/91689#M19364</guid>
      <dc:creator>Doug</dc:creator>
      <dc:date>2012-12-11T14:39:51Z</dc:date>
    </item>
  </channel>
</rss>

