<?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 Assigning unique ID to a subset of observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assigning-unique-ID-to-a-subset-of-observations/m-p/450035#M113316</link>
    <description>&lt;P&gt;I have a panel data with 1002 observations. N=334, T=3. My goal is to create 2 columns representing N and the year T. For example, the first 334 observations will have ID from 1 to 334 and a fixed value of T=1. The next set will have observations from 335 to 668 and T=2. I tried this piece of code but it did not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WAGE;&lt;BR /&gt;SET WAGE(first_obs = 2)(obs = 335);&lt;BR /&gt;retain Person_ID = 1;&lt;BR /&gt;retain Year_ID = 1;&lt;BR /&gt;Person_ID + 1;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Mar 2018 19:46:53 GMT</pubDate>
    <dc:creator>adityal2810</dc:creator>
    <dc:date>2018-03-30T19:46:53Z</dc:date>
    <item>
      <title>Assigning unique ID to a subset of observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-unique-ID-to-a-subset-of-observations/m-p/450035#M113316</link>
      <description>&lt;P&gt;I have a panel data with 1002 observations. N=334, T=3. My goal is to create 2 columns representing N and the year T. For example, the first 334 observations will have ID from 1 to 334 and a fixed value of T=1. The next set will have observations from 335 to 668 and T=2. I tried this piece of code but it did not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WAGE;&lt;BR /&gt;SET WAGE(first_obs = 2)(obs = 335);&lt;BR /&gt;retain Person_ID = 1;&lt;BR /&gt;retain Year_ID = 1;&lt;BR /&gt;Person_ID + 1;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2018 19:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-unique-ID-to-a-subset-of-observations/m-p/450035#M113316</guid>
      <dc:creator>adityal2810</dc:creator>
      <dc:date>2018-03-30T19:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning unique ID to a subset of observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-unique-ID-to-a-subset-of-observations/m-p/450050#M113318</link>
      <description>&lt;P&gt;Could be as basic as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
do T = 1 to 3;
    do ID = 1 to 334;
        set WAGE;
        output;
        end;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Mar 2018 20:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-unique-ID-to-a-subset-of-observations/m-p/450050#M113318</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-03-30T20:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning unique ID to a subset of observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-unique-ID-to-a-subset-of-observations/m-p/450060#M113319</link>
      <description>&lt;P&gt;Perhaps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   set wage;
   id=_n_;
   t = floor((_n_-1)/334)+1;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Mar 2018 20:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-unique-ID-to-a-subset-of-observations/m-p/450060#M113319</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-30T20:28:03Z</dc:date>
    </item>
  </channel>
</rss>

