<?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 Grouping variables in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Grouping-variables-in-SAS/m-p/653976#M196447</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I am trying to find the equivalent of the Stata code "egen group" in SAS. The goal is: I have three variables x, y, and z. I want to create a new variable which will assign a different ordinal number for each combination of values of x, y, and z. How can I do this in SAS?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 07 Jun 2020 01:26:51 GMT</pubDate>
    <dc:creator>n7</dc:creator>
    <dc:date>2020-06-07T01:26:51Z</dc:date>
    <item>
      <title>Grouping variables in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Grouping-variables-in-SAS/m-p/653976#M196447</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to find the equivalent of the Stata code "egen group" in SAS. The goal is: I have three variables x, y, and z. I want to create a new variable which will assign a different ordinal number for each combination of values of x, y, and z. How can I do this in SAS?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 01:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Grouping-variables-in-SAS/m-p/653976#M196447</guid>
      <dc:creator>n7</dc:creator>
      <dc:date>2020-06-07T01:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping variables in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Grouping-variables-in-SAS/m-p/653981#M196450</link>
      <description>&lt;P&gt;With hope I understand you correctly, use next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have; by x y z; run;
data new;
 set have;
  by x y z;
      retain key;
      if first.z then key+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Jun 2020 02:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Grouping-variables-in-SAS/m-p/653981#M196450</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-06-07T02:35:15Z</dc:date>
    </item>
  </channel>
</rss>

