<?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: SORTEDBY=_NULL_ in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503339#M134483</link>
    <description>&lt;P&gt;As the&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=ledsoptsref&amp;amp;docsetTarget=p1pnjylslu2ryrn1ra3a6ney2bzs.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=da" target="_self"&gt;SORTEDBY= Data Set Option Documentation&lt;/A&gt;&amp;nbsp;says it "&lt;SPAN&gt;removes any existing sort indicator." &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A small example demonstrates the option&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SomeData;
input x @@;
datalines;
3 2 5 1 6 4 8 5
;

proc sort data=SomeData;
   by x;
run;

/* SAS knows that SomeData is sorted (Sorted=Yes) */
proc contents data=SomeData;
run;

/* Sortedby=_null_ forces SAS to forget the sort information (Sorted=No) */
data test(sortedby=_null_);
   set SomeData;
run;
proc contents data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Oct 2018 09:16:31 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-10-11T09:16:31Z</dc:date>
    <item>
      <title>SORTEDBY=_NULL_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503337#M134481</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please say what is the context in the "SORTEDBY=_NULL_" (unfortunately I can not ask the author) in the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA test (SORTEDBY=_NULL_);
  SET pretest;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dataset pretest was previously sorted by one variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 09:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503337#M134481</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-10-11T09:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: SORTEDBY=_NULL_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503339#M134483</link>
      <description>&lt;P&gt;As the&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=ledsoptsref&amp;amp;docsetTarget=p1pnjylslu2ryrn1ra3a6ney2bzs.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=da" target="_self"&gt;SORTEDBY= Data Set Option Documentation&lt;/A&gt;&amp;nbsp;says it "&lt;SPAN&gt;removes any existing sort indicator." &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A small example demonstrates the option&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SomeData;
input x @@;
datalines;
3 2 5 1 6 4 8 5
;

proc sort data=SomeData;
   by x;
run;

/* SAS knows that SomeData is sorted (Sorted=Yes) */
proc contents data=SomeData;
run;

/* Sortedby=_null_ forces SAS to forget the sort information (Sorted=No) */
data test(sortedby=_null_);
   set SomeData;
run;
proc contents data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Oct 2018 09:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503339#M134483</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-10-11T09:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: SORTEDBY=_NULL_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503340#M134484</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Taken from the documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000131184.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000131184.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;removes any existing sort indicator&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 09:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503340#M134484</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2018-10-11T09:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: SORTEDBY=_NULL_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503353#M134490</link>
      <description>&lt;P&gt;Thank you, draycut. I just do not understand for what was it needed that "SAS to forget the sort information"...&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 10:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503353#M134490</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-10-11T10:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: SORTEDBY=_NULL_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503381#M134499</link>
      <description>&lt;P&gt;In that step it is not needed since SAS will not be storing any SORTEDBY information for a dataset created in that way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps they had a previous process that did generate the data in a sorted order and they wanted to force SAS to store the fact it was sorted.&amp;nbsp; So they were in the habit of using the SORTEDBY= dataset option and instead of removing it totally they just set the list of variables to _NULL_.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 12:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SORTEDBY-NULL/m-p/503381#M134499</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-11T12:21:25Z</dc:date>
    </item>
  </channel>
</rss>

