<?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: ERROR: BY variables are not properly sorted on data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579374#M164458</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like this, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=tempsas.ind_conc out=tempsas.ind_conc_sort;&lt;BR /&gt;by indCode_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2019 13:57:41 GMT</pubDate>
    <dc:creator>Afor910327</dc:creator>
    <dc:date>2019-08-06T13:57:41Z</dc:date>
    <item>
      <title>ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579369#M164455</link>
      <description />
      <pubDate>Wed, 07 Aug 2019 13:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579369#M164455</guid>
      <dc:creator>Afor910327</dc:creator>
      <dc:date>2019-08-07T13:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579371#M164456</link>
      <description>&lt;P&gt;Please sort the &lt;CODE class="txt"&gt;tempsas.ind_conc by indCode_id before the merge step to avoid the error. &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 13:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579371#M164456</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-08-06T13:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579372#M164457</link>
      <description>&lt;P&gt;Use PROC SORT and sort your data properly before merging.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 13:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579372#M164457</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-06T13:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579374#M164458</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like this, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=tempsas.ind_conc out=tempsas.ind_conc_sort;&lt;BR /&gt;by indCode_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 13:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579374#M164458</guid>
      <dc:creator>Afor910327</dc:creator>
      <dc:date>2019-08-06T13:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579379#M164459</link>
      <description>&lt;P&gt;yes&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 14:05:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579379#M164459</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-08-06T14:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579393#M164464</link>
      <description>&lt;P&gt;Any procedure or data step that uses a BY statement will require the data to be sorted by the same variables listed in the same order as the By statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 14:24:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579393#M164464</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-06T14:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579395#M164465</link>
      <description>&lt;P&gt;Thank you Jag, but I keep getting the same error, time after time...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the latest log, I had done this before and nothing works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 14:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579395#M164465</guid>
      <dc:creator>Afor910327</dc:creator>
      <dc:date>2019-08-06T14:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579403#M164468</link>
      <description>&lt;P&gt;You forgot to replace the data set name in the merge with the new sorted data set name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;TEMPSAS.IND_CONC&lt;/PRE&gt;
&lt;P&gt;is not ind_conc_SORTED&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/105695"&gt;@Afor910327&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you Jag, but I keep getting the same error, time after time...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached the latest log, I had done this before and nothing works!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 14:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579403#M164468</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-06T14:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579412#M164472</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response, SAS is by far the worst language of all, I keep following the tips of everyone here and nothing seems to work at all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 15:08:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579412#M164472</guid>
      <dc:creator>Afor910327</dc:creator>
      <dc:date>2019-08-06T15:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579415#M164474</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/105695"&gt;@Afor910327&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your response, SAS is by far the worst language of all, I keep following the tips of everyone here and nothing seems to work at all.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're sorting the data set but using the wrong name after.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're sorted data set name is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc sort data=&lt;STRONG&gt;&lt;FONT size="5" color="#FF0000"&gt;tempsas.ind_conc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT size="5" color="#008000"&gt;&lt;STRONG&gt;out=tempsas.ind_conc_sort;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by indCode_id;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But in the merge code you're using:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: BY variables are not properly sorted on data set &lt;STRONG&gt;&lt;FONT size="5" color="#FF0000"&gt;TEMPSAS.IND_CONC&lt;/FONT&gt;&lt;/STRONG&gt;.
a=1 indCode_id=41991 datasetPeriod_id=1576 proVal=4.3776485046 Inter=3531.2584548 compensation=2528.7734829 taxes=45.311020873
GOS=-6100.96531 indCode=333517 indCodeDescr=Machine tool (metal forming types) manufacturing indACPSA=ind99
indACPSADescr=All Other Industries FIRST.indCode_id=1 LAST.indCode_id=0 _ERROR_=1 _N_=549
NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 543 observations read from the data set TEMPSAS.IND_VALUE_ADDED.
NOTE: There were 313 observations read from the data set TEMPSAS.IND_CONC.
WARNING: The data set TEMPSAS.IND_VA_BY_ACPSA may be incomplete.  When this step was stopped there were 545 observations and 11
         variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Fix your code to use the correct input data set to be merged. If you don't want to deal with presorting the data sets then merge using SQL instead.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 15:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579415#M164474</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-06T15:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579482#M164489</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/105695"&gt;@Afor910327&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your response, SAS is by far the worst language of all, I keep following the tips of everyone here and nothing seems to work at all.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Say that after you have done some assembler programming. &lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://communities.sas.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Spelling is critical in every programming language I know and using the wrong reference seldom yields desired results.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 19:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579482#M164489</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-06T19:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: BY variables are not properly sorted on data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579649#M164555</link>
      <description>&lt;P&gt;Thank you so much, finally it worked for now!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 13:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-BY-variables-are-not-properly-sorted-on-data-set/m-p/579649#M164555</guid>
      <dc:creator>Afor910327</dc:creator>
      <dc:date>2019-08-07T13:02:54Z</dc:date>
    </item>
  </channel>
</rss>

