<?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 sorting dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/250993#M47357</link>
    <description>&lt;P&gt;I am trying to sort my data based on the number of appearances in descending order and then only printing the variables host and the fifth day of showing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I keep getting the following error messages:&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;58 run;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Variable NAME not found.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;DIV class="sasError"&gt;ERROR: Variable FIFTH not found.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Variable HOST not found.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;the code I used is as follows:&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;proc sort data=snl out=snl2;&lt;BR /&gt;by appearances descending;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=snl2;&lt;BR /&gt;var fifth host;&lt;BR /&gt;run;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 19 Feb 2016 00:54:49 GMT</pubDate>
    <dc:creator>MadQuidd</dc:creator>
    <dc:date>2016-02-19T00:54:49Z</dc:date>
    <item>
      <title>sorting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/250993#M47357</link>
      <description>&lt;P&gt;I am trying to sort my data based on the number of appearances in descending order and then only printing the variables host and the fifth day of showing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I keep getting the following error messages:&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;58 run;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Variable NAME not found.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;DIV class="sasError"&gt;ERROR: Variable FIFTH not found.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Variable HOST not found.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;the code I used is as follows:&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;proc sort data=snl out=snl2;&lt;BR /&gt;by appearances descending;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=snl2;&lt;BR /&gt;var fifth host;&lt;BR /&gt;run;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 19 Feb 2016 00:54:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/250993#M47357</guid>
      <dc:creator>MadQuidd</dc:creator>
      <dc:date>2016-02-19T00:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: sorting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/250995#M47358</link>
      <description>&lt;P&gt;You never reference NAME so I have a hard time seeing how that error message belongs to the code you're showing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you post the full code, the full log and the output from PROC CONTENTS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date variables sort the same as any other variables. I'm not seeing how a data has any effect on your code at this point.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 00:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/250995#M47358</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-19T00:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: sorting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/250997#M47359</link>
      <description>&lt;P&gt;the order come before the variable name;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=snl out=snl2;
&lt;STRONG&gt;by descending&lt;/STRONG&gt; appearances ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Feb 2016 01:01:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/250997#M47359</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-02-19T01:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: sorting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/250998#M47360</link>
      <description>&lt;P&gt;You also need to put descending BEFORE the variable you want to sort descending.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's what's likely generating your error.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 01:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/250998#M47360</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-19T01:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: sorting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/251000#M47361</link>
      <description>&lt;DIV&gt;&lt;DIV class="sasSource"&gt;THis is the entirety of the log with the error messages:&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;55&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;56 proc sort data=snl out=snl2;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;57 by appearances descending;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_&lt;/DIV&gt;&lt;DIV class="sasError"&gt;22&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;58 run;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Variable NAME not found.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The data set WORK.SNL2 may be incomplete. When this step was stopped there were 0 observations and 0 variables.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: Data set WORK.SNL2 was not replaced because this step was stopped.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.03 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.03 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;59 proc print data=snl2;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;60 var fifth host;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Variable FIFTH not found.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Variable HOST not found.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;61 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;62&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;63 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Here is the code:&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;data SNL;&lt;BR /&gt;length host $ 18;&lt;BR /&gt;input Host &amp;amp; $28. Appearances First: mmddyy10. Fifth: date8.;&lt;BR /&gt;format first fifth mmddyy8.;&lt;BR /&gt;datalines;&lt;BR /&gt;Ben Affleck 5 2/19/2000 18-May-13&lt;BR /&gt;Alec Baldwin 16 4/21/1990 10-Dec-94&lt;BR /&gt;Drew Barrymore 6 11/20/1982 03-Feb-07&lt;BR /&gt;Candice Bergen 5 11/8/1975 19-May-90&lt;BR /&gt;Chevy Chase 8 2/18/1978 06-Dec-86&lt;BR /&gt;Danny DeVito 6 5/15/1982 09-Jan-93&lt;BR /&gt;John Goodman 13 12/2/1989 07-May-94&lt;BR /&gt;Elliott Gould 6 1/10/1976 16-Feb-80&lt;BR /&gt;Tom Hanks 8 12/14/1985 08-Dec-90&lt;BR /&gt;Buck Henry 10 1/17/1976 19-Nov-77&lt;BR /&gt;Steve Martin 15 10/23/1976 22-Apr-78&lt;BR /&gt;Bill Murray 5 3/7/1981 20-Feb-99&lt;BR /&gt;Justin Timberlake 5 10/11/2003 09-Mar-13&lt;BR /&gt;Christopher Walken 7 1/20/1990 19-May-01&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=snl;&lt;BR /&gt;format first mmddyy8.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc sort data=snl out=snl2;&lt;BR /&gt;by appearances descending;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=snl2;&lt;BR /&gt;var fifth host;&lt;BR /&gt;run;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;I dont understand the error messages at all the dont make sense to me.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 19 Feb 2016 01:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sorting-dates/m-p/251000#M47361</guid>
      <dc:creator>MadQuidd</dc:creator>
      <dc:date>2016-02-19T01:03:24Z</dc:date>
    </item>
  </channel>
</rss>

