<?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: Swap rows with missing values with the ones without missing in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Swap-rows-with-missing-values-with-the-ones-without-missing/m-p/952322#M42806</link>
    <description>&lt;P&gt;Given this trivial example, is it safe to assume that sorting always solves the problem? Could there be cases where sorting does not solve the problem?&lt;/P&gt;</description>
    <pubDate>Mon, 02 Dec 2024 18:04:34 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-12-02T18:04:34Z</dc:date>
    <item>
      <title>Swap rows with missing values with the ones without missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Swap-rows-with-missing-values-with-the-ones-without-missing/m-p/952317#M42804</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;suppose to have the following:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input ID :$20. Admission :date09. Discharge :date09. Variable1 Variable2; 
  format Admission date9. Discharge date9.;
cards;
0001 13JAN2015 20JAN2015 1  0 
0001 21FEB2015 31DEC2015  .  . 
0001 21FEB2015 31DEC2015 0  1 
; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is there a way to swap rows with missing values to have the following?&lt;/P&gt;
&lt;P&gt;Rows with missing values are present only when there are identical and replicated rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
  input ID :$20. Admission :date09. Discharge :date09. Variable1 Variable2; 
  format Admission date9. Discharge date9.;
cards;
0001 13JAN2015 20JAN2015 1  0 
0001 21FEB2015 31DEC2015 0  1
0001 21FEB2015 31DEC2015  .  .  
; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 16:54:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Swap-rows-with-missing-values-with-the-ones-without-missing/m-p/952317#M42804</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2024-12-02T16:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Swap rows with missing values with the ones without missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Swap-rows-with-missing-values-with-the-ones-without-missing/m-p/952318#M42805</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134532"&gt;@NewUsrStat&lt;/a&gt;, a simple sort will work here, making sure to sort by all columns and descending values for variable1/2:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have out=want;
	by id admission discharge &lt;FONT color="#FF0000"&gt;descending&lt;/FONT&gt; variable1 &lt;FONT color="#FF0000"&gt;descending&lt;/FONT&gt; variable2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 17:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Swap-rows-with-missing-values-with-the-ones-without-missing/m-p/952318#M42805</guid>
      <dc:creator>antonbcristina</dc:creator>
      <dc:date>2024-12-02T17:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Swap rows with missing values with the ones without missing</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Swap-rows-with-missing-values-with-the-ones-without-missing/m-p/952322#M42806</link>
      <description>&lt;P&gt;Given this trivial example, is it safe to assume that sorting always solves the problem? Could there be cases where sorting does not solve the problem?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 18:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Swap-rows-with-missing-values-with-the-ones-without-missing/m-p/952322#M42806</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-12-02T18:04:34Z</dc:date>
    </item>
  </channel>
</rss>

