<?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: Create ID variable for multiple records per individual in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Create-ID-variable-for-multiple-records-per-individual/m-p/216754#M5293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stub code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have; by ID date;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by Id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retain IdRec .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.id the IdRec=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else IdRec+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Apr 2015 16:46:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-04-06T16:46:00Z</dc:date>
    <item>
      <title>Create ID variable for multiple records per individual</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Create-ID-variable-for-multiple-records-per-individual/m-p/216753#M5292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an id variable, and I have multiple observations per id (patients with multiple specimens). I want to create a new ID variable containing 1 for the first ID, 2 for the second, and so on.&amp;nbsp; I have a date variable.&amp;nbsp; This in preparation for transposing the dataset to have one row per patient with columns for the variables related to specimen 1, specimen 2, etc.&amp;nbsp; Open to ideas of better ways to do this, but I was going to use the new ID variable as my prefix.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 16:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Create-ID-variable-for-multiple-records-per-individual/m-p/216753#M5292</guid>
      <dc:creator>ash</dc:creator>
      <dc:date>2015-04-06T16:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create ID variable for multiple records per individual</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Create-ID-variable-for-multiple-records-per-individual/m-p/216754#M5293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stub code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have; by ID date;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by Id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Retain IdRec .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.id the IdRec=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else IdRec+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 16:46:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Create-ID-variable-for-multiple-records-per-individual/m-p/216754#M5293</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-06T16:46:00Z</dc:date>
    </item>
  </channel>
</rss>

