<?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 not working in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696380#M25260</link>
    <description>&lt;P&gt;That did the trick - thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 03 Nov 2020 23:59:18 GMT</pubDate>
    <dc:creator>sjbothwell</dc:creator>
    <dc:date>2020-11-03T23:59:18Z</dc:date>
    <item>
      <title>PROC SORT not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696369#M25253</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to sort data by Subject_ID (primary) and Lab_Date. When I run the following code the data doesn't appear to be sorted :&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SORT DATA = WORK.Laboratory_2015;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; BY Subject_ID Lab_Date;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data looks like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sjbothwell_0-1604446098269.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51346i1C61D01E923EE19A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sjbothwell_0-1604446098269.png" alt="sjbothwell_0-1604446098269.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 23:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696369#M25253</guid>
      <dc:creator>sjbothwell</dc:creator>
      <dc:date>2020-11-03T23:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696370#M25254</link>
      <description>&lt;P&gt;Please post the SAS log of your PROC SORT.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 23:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696370#M25254</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-03T23:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696372#M25255</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/344926"&gt;@sjbothwell&lt;/a&gt;&amp;nbsp; That seems strange. Can you try&amp;nbsp;&lt;SPAN&gt;writing the sorted contents to new dataset and compare-&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SORT DATA = WORK.Laboratory_2015 out=sorted_lab_2015;
      BY Subject_ID Lab_Date;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Please open both sorted_lab_2015 and&amp;nbsp;WORK.Laboratory_2015 and eyeball&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 23:39:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696372#M25255</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-11-03T23:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696374#M25256</link>
      <description>&lt;P&gt;My initial code was&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SORT DATA = CanImpt.Laboratory_2015;&lt;BR /&gt;BY Subject_ID Lab_Date;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;Where CanImpt was a file path on my computer and the log gave this error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: You cannot open CANIMPT.LABORATORY_2015.DATA for output access with member-level control because CANIMPT.LABORATORY_2015.DATA is in use by you in resource environment SORT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed CanImpt to WORK for the post but just realized that by using&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WORK.Laboratory_2015;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; SET CanImpt.Laboratory_2015;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;and then sorting off of WORK.Laboratory_2015 works. Why do I need a temporary dataset? Or is there a better method?&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>Tue, 03 Nov 2020 23:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696374#M25256</guid>
      <dc:creator>sjbothwell</dc:creator>
      <dc:date>2020-11-03T23:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696375#M25257</link>
      <description>&lt;P&gt;The result looks like you actually ran at some point:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SORT DATA = WORK.Laboratory_2015;&lt;BR /&gt;BY Lab_Date Subject_ID;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you did sort this way and the data set was open for some reason then a different sort may not have been done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 23:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696375#M25257</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-03T23:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696376#M25258</link>
      <description>&lt;P&gt;That worked thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 23:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696376#M25258</guid>
      <dc:creator>sjbothwell</dc:creator>
      <dc:date>2020-11-03T23:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696378#M25259</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/344926"&gt;@sjbothwell&lt;/a&gt;&amp;nbsp; - Looks like you have a process already locking your permanent dataset so you can't overwrite it. Try closing your SAS session, reopen it and try the sort again.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 23:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696378#M25259</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-03T23:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696380#M25260</link>
      <description>&lt;P&gt;That did the trick - thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 23:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696380#M25260</guid>
      <dc:creator>sjbothwell</dc:creator>
      <dc:date>2020-11-03T23:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SORT not working</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696395#M25264</link>
      <description>&lt;P&gt;Like the earlier commenters, double check the datasets you are referencing and make sure that they work in your log and are correctly named.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't see if you named the dataset into your log (Make sure you are not missing something like this):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WORK.LABORATORY_2015;&lt;BR /&gt;SET CANIMPT.LABORATORY_2015;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then run the proc sort statement:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC SORT DATA = WORK.LABORATORY_2015;&lt;BR /&gt;BY SUBJECT_ID LAB_DATE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if that is still not working you can achieve the same grouping result in a different way:&lt;/P&gt;&lt;P&gt;PROC PRINT DATA = WORK.LABORATORY_2015;&lt;BR /&gt;BY SUBJECT_ID LAB_DATE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While this method isn't great for large datasets with a lot of unique variables of Subject_ID, Lab_Date, it is good for seeing trends in a more bitesized way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 03:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-SORT-not-working/m-p/696395#M25264</guid>
      <dc:creator>Deanna_Payne</dc:creator>
      <dc:date>2020-11-04T03:37:41Z</dc:date>
    </item>
  </channel>
</rss>

