<?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: Proc sort vs %sort in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-vs-sort/m-p/894402#M353301</link>
    <description>&lt;P&gt;This looks like a macro call to a site specific custom macro and though we can't know what this macro does.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use below two options then you'll get in the SAS log what SAS code the macro generates as well as where the macro definition is stored in your environment. That should answer your question - else please share the log created when running below and eventually also the macro definition (the code from the .sas file from the location where the log tells you it found the macro definition).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint mautolocdisplay;
%sort(data.rade,camp_cd appl_id RADE_RELSHIP_TYP RADE_ACCT_NO,option=nodupkey)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Sep 2023 00:51:55 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2023-09-15T00:51:55Z</dc:date>
    <item>
      <title>Proc sort vs %sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-vs-sort/m-p/894389#M353296</link>
      <description>&lt;P&gt;How would i write the following %sort statement using proc sort?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%sort(data.rade,camp_cd appl_id RADE_RELSHIP_TYP RADE_ACCT_NO,option=nodupkey)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe it would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=data.rade&amp;nbsp;nodupkey;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; by&amp;nbsp;camp_cd appl_id RADE_RELSHIP_TYP RADE_ACCT_NO;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this correct/will give me the same results?&amp;nbsp; Also, can %sort be used outside of a macro?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 21:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort-vs-sort/m-p/894389#M353296</guid>
      <dc:creator>aamoen</dc:creator>
      <dc:date>2023-09-14T21:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort vs %sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-vs-sort/m-p/894395#M353298</link>
      <description>&lt;P&gt;%sort would, in SAS, refer to macro code or "is a macro".&amp;nbsp; So "outside of a macro" is pretty meaningless but would be usable. The code could do anything. If you cannot provide the source code of %sort we really can't answer this completely. I don't recognize this is a standard SAS supplied macro so would not even bother to guess.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF this is SAS code set options MPRINT before executing it. That will show the statements generated by the macro in the log:&lt;/P&gt;
&lt;PRE&gt;options mprint;

%sort(data.rade,camp_cd appl_id RADE_RELSHIP_TYP RADE_ACCT_NO,option=nodupkey)

options nomprint; /* turn off the option*/&lt;/PRE&gt;
&lt;P&gt;If you have questions about the content of the log then copy ALL the text from the log, open a text box on the forum using the &amp;lt;/&amp;gt; icon above the message window and pasting the text.&lt;/P&gt;
&lt;P&gt;The text, you can see on above, is important to preserve line formatting as the main message window on this forum is known to reformat pasted text and may move stuff making it harder to understand, especially warnings and error messages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If %sort is supposed to be from another programming language then you need to tell us what it is supposed to do.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 23:01:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort-vs-sort/m-p/894395#M353298</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-14T23:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort vs %sort</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sort-vs-sort/m-p/894402#M353301</link>
      <description>&lt;P&gt;This looks like a macro call to a site specific custom macro and though we can't know what this macro does.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use below two options then you'll get in the SAS log what SAS code the macro generates as well as where the macro definition is stored in your environment. That should answer your question - else please share the log created when running below and eventually also the macro definition (the code from the .sas file from the location where the log tells you it found the macro definition).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint mautolocdisplay;
%sort(data.rade,camp_cd appl_id RADE_RELSHIP_TYP RADE_ACCT_NO,option=nodupkey)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 00:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sort-vs-sort/m-p/894402#M353301</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-09-15T00:51:55Z</dc:date>
    </item>
  </channel>
</rss>

