<?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 Why would &amp;quot;retain&amp;quot; in the data statement fail to reorder variables? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Why-would-quot-retain-quot-in-the-data-statement-fail-to-reorder/m-p/50711#M13855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order for the retain statement to do what you want it must come BEFORE the set statement.&amp;nbsp; Similarly, if you want to drop some variables, you can do that in the set statement using the (drop=variablenamesseparatedbyspaces) option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Feb 2012 20:48:27 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-02-09T20:48:27Z</dc:date>
    <item>
      <title>Why would "retain" in the data statement fail to reorder variables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-would-quot-retain-quot-in-the-data-statement-fail-to-reorder/m-p/50710#M13854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This does what I'd expect...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sample;&lt;/P&gt;&lt;P&gt;input d c b a;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;4 3 2 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data retain_method;&lt;/P&gt;&lt;P&gt;retain a b c d;&lt;/P&gt;&lt;P&gt;set sample;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following prints all variables, but fails to reorder them or drop the ones I don't want.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp; Dataset work.a has a mixture of character, date, time, numerical values, and my retain statement is not calling them all because I want to drop them.&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 b;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set a;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain GPS_Date GPS_Time GPS_Second Name Speed Bearing Inclinatio East North Up Max_PDOP Max_HDOP&amp;nbsp; Northing Easting;&lt;/P&gt;&lt;P&gt;proc print data=b (obs=40);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 20:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-would-quot-retain-quot-in-the-data-statement-fail-to-reorder/m-p/50710#M13854</guid>
      <dc:creator>iiibbb</dc:creator>
      <dc:date>2012-02-09T20:44:34Z</dc:date>
    </item>
    <item>
      <title>Why would "retain" in the data statement fail to reorder variables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Why-would-quot-retain-quot-in-the-data-statement-fail-to-reorder/m-p/50711#M13855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order for the retain statement to do what you want it must come BEFORE the set statement.&amp;nbsp; Similarly, if you want to drop some variables, you can do that in the set statement using the (drop=variablenamesseparatedbyspaces) option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 20:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Why-would-quot-retain-quot-in-the-data-statement-fail-to-reorder/m-p/50711#M13855</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-09T20:48:27Z</dc:date>
    </item>
  </channel>
</rss>

