<?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: Why we keep the same variable with &amp;quot;by&amp;quot; in proc sort with nodupkey option? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-we-keep-the-same-variable-with-quot-by-quot-in-proc-sort/m-p/726926#M225970</link>
    <description>&lt;P&gt;The obvious purpose to me is to create an ascending order list of the unique values in variable LOC.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Mar 2021 22:12:44 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2021-03-16T22:12:44Z</dc:date>
    <item>
      <title>Why we keep the same variable with "by" in proc sort with nodupkey option?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-we-keep-the-same-variable-with-quot-by-quot-in-proc-sort/m-p/726921#M225967</link>
      <description>&lt;P&gt;Hi all SAS Users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This morning, I read a set of code as below, I do not understand the underlying reason of the code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=my.keepvar_1999_2000 (keep=LOC)
	out= want NODUPKEY;
	by LOC;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I do not know why they keep LOC while they sort by LOC in this case (LOC is a character variable denoted the country) . Could you please explain it to me?&lt;/P&gt;
&lt;P&gt;Warm regards.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 21:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-we-keep-the-same-variable-with-quot-by-quot-in-proc-sort/m-p/726921#M225967</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-03-16T21:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why we keep the same variable with "by" in proc sort with nodupkey option?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-we-keep-the-same-variable-with-quot-by-quot-in-proc-sort/m-p/726923#M225969</link>
      <description>&lt;P&gt;The main purpose of selecting specific variables from the source data would be to reduce the size the output data set to what the coder only needs to use later.&lt;/P&gt;
&lt;P&gt;A secondary reason could be to reduce the size of the temporary data set(s) that Proc Sort generates while executing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only need one variable but the data set has 100 more variables then disk space and memory is needed in execution for stuff that you don't want. So the code would run faster using less resources.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 21:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-we-keep-the-same-variable-with-quot-by-quot-in-proc-sort/m-p/726923#M225969</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-16T21:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Why we keep the same variable with "by" in proc sort with nodupkey option?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-we-keep-the-same-variable-with-quot-by-quot-in-proc-sort/m-p/726926#M225970</link>
      <description>&lt;P&gt;The obvious purpose to me is to create an ascending order list of the unique values in variable LOC.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 22:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-we-keep-the-same-variable-with-quot-by-quot-in-proc-sort/m-p/726926#M225970</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-03-16T22:12:44Z</dc:date>
    </item>
  </channel>
</rss>

