<?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: Column Ordering in the Data Step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Column-Ordering-in-the-Data-Step/m-p/305015#M312495</link>
    <description>&lt;P&gt;Thank you, this makes sense.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2016 08:35:45 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2016-10-17T08:35:45Z</dc:date>
    <item>
      <title>Column Ordering in the Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Column-Ordering-in-the-Data-Step/m-p/304995#M312492</link>
      <description>&lt;P&gt;Hi All.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I like to control the column ordering of my data with a format statement immediately after the data statement as such&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data test;
   format type origin;
   set sashelp.cars;
run;&lt;/PRE&gt;&lt;P&gt;, but I am yet to understand the logic as to why I do not get the same result when placing it after the set statement as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data test;
   set sashelp.cars;
   format type origin;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Can anyone enlighten me? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 07:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Column-Ordering-in-the-Data-Step/m-p/304995#M312492</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-10-17T07:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Column Ordering in the Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Column-Ordering-in-the-Data-Step/m-p/304997#M312493</link>
      <description>&lt;P&gt;When the compiler builds the data step, it creates the PDV from the code it encounters. When a set statement is read, the data set is opened and the columns are put into the PDV, unless they are already there (at least in name). Therefore the ordering is set in example 1 by the format statement, and in example 2 by the ordering in sashelp.cars.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 08:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Column-Ordering-in-the-Data-Step/m-p/304997#M312493</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-17T08:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Column Ordering in the Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Column-Ordering-in-the-Data-Step/m-p/305000#M312494</link>
      <description>&lt;P&gt;Oreder of variables are defined by their &lt;STRONG&gt;first&lt;/STRONG&gt; occurence in the datastep.&lt;/P&gt;
&lt;P&gt;When you do SET before FORMAT, the order is taken from the input dataset.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 08:05:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Column-Ordering-in-the-Data-Step/m-p/305000#M312494</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-10-17T08:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Column Ordering in the Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Column-Ordering-in-the-Data-Step/m-p/305015#M312495</link>
      <description>&lt;P&gt;Thank you, this makes sense.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2016 08:35:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Column-Ordering-in-the-Data-Step/m-p/305015#M312495</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-10-17T08:35:45Z</dc:date>
    </item>
  </channel>
</rss>

