<?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: sas base question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/536236#M147334</link>
    <description>Should ID really change just because the order of the observations changes?&lt;BR /&gt;&lt;BR /&gt;Here is an approach that works but doesn't change ID.  It requires that your data contains equal numbers of M and F values:&lt;BR /&gt;&lt;BR /&gt;Data want;&lt;BR /&gt;Set have (where=(gender="M"));&lt;BR /&gt;output;&lt;BR /&gt;Set have (where=(gender="F"));&lt;BR /&gt;output;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;The ID can be recomputed if necessary.  Instead of&lt;BR /&gt;&lt;BR /&gt;1 2 3 4 5 6 7 8&lt;BR /&gt;&lt;BR /&gt;you will get&lt;BR /&gt;&lt;BR /&gt;1 5 2 6 3 7 4 8&lt;BR /&gt;&lt;BR /&gt;It's not clear which set of ID values would be more useful.  Perhaps there should even be a third variable added to the new data set so you would both the original order and the new order available.</description>
    <pubDate>Sun, 17 Feb 2019 07:45:44 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-02-17T07:45:44Z</dc:date>
    <item>
      <title>sas base question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/536223#M147330</link>
      <description>&lt;P&gt;i have a dataset&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data xxx;&lt;/P&gt;&lt;P&gt;id gender&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; M&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; M&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; M&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; M&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/P&gt;&lt;P&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/P&gt;&lt;P&gt;7&amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/P&gt;&lt;P&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need the output this way&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id gender&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; M&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; M&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; M&lt;/P&gt;&lt;P&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/P&gt;&lt;P&gt;7&amp;nbsp; &amp;nbsp; &amp;nbsp; M&lt;/P&gt;&lt;P&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to do it in base sas.. can anyone hep me out in this pls&lt;/P&gt;</description>
      <pubDate>Sun, 17 Feb 2019 05:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/536223#M147330</guid>
      <dc:creator>ravikiran2627</dc:creator>
      <dc:date>2019-02-17T05:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: sas base question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/536231#M147331</link>
      <description>&lt;P&gt;Set gender depending on mod(_n_,2).&lt;/P&gt;</description>
      <pubDate>Sun, 17 Feb 2019 06:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/536231#M147331</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-17T06:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: sas base question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/536236#M147334</link>
      <description>Should ID really change just because the order of the observations changes?&lt;BR /&gt;&lt;BR /&gt;Here is an approach that works but doesn't change ID.  It requires that your data contains equal numbers of M and F values:&lt;BR /&gt;&lt;BR /&gt;Data want;&lt;BR /&gt;Set have (where=(gender="M"));&lt;BR /&gt;output;&lt;BR /&gt;Set have (where=(gender="F"));&lt;BR /&gt;output;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;The ID can be recomputed if necessary.  Instead of&lt;BR /&gt;&lt;BR /&gt;1 2 3 4 5 6 7 8&lt;BR /&gt;&lt;BR /&gt;you will get&lt;BR /&gt;&lt;BR /&gt;1 5 2 6 3 7 4 8&lt;BR /&gt;&lt;BR /&gt;It's not clear which set of ID values would be more useful.  Perhaps there should even be a third variable added to the new data set so you would both the original order and the new order available.</description>
      <pubDate>Sun, 17 Feb 2019 07:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/536236#M147334</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-17T07:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: sas base question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/536432#M147420</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 

data xxx;
input id gender $;
drop id;
cards;
1      M
2      M
3      M
4      M
5      F
6      F
7      F
8      F
;
data temp;
 set xxx;
 by gender notsorted;
 if first.gender then n=0;
 n+1;
run;
proc sort data=temp;
by n descending gender ;
run;
data want;
 set temp;
 id+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Feb 2019 11:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/536432#M147420</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-02-18T11:15:56Z</dc:date>
    </item>
  </channel>
</rss>

