<?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: Flagging a subject based on visit and it's corresponding dates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121202#M33418</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; id visit;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; (first.id or first.visit) NE (last.id or last.visit) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; flag + &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; first.id or first.visit &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; flag = &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Urvish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Aug 2013 07:30:13 GMT</pubDate>
    <dc:creator>UrvishShah</dc:creator>
    <dc:date>2013-08-26T07:30:13Z</dc:date>
    <item>
      <title>Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121194#M33410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me in tacking the below and assigning them the flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is are unique records, I want to flag and increment if they fall under same visit and id, and reflag if not same visit&lt;/P&gt;&lt;P&gt;id date visit output&lt;/P&gt;&lt;P&gt;1 2001-02-21 3 ---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;1 2001-02-22 3 ---------------&amp;gt;flag =2&lt;/P&gt;&lt;P&gt;2 2002-02-26 9 ---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;3 2002-12-13 2 ---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;3 2002-12-29 9 ---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2004-12-13 7 ----------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2004-12-14 7 -----------------&amp;gt;flag =2&lt;/P&gt;&lt;P&gt;4 2005-01-06 24 ------------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2005-01-07 24 ------------------&amp;gt;flag =2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For above:&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;infile datalines dsd;&lt;/P&gt;&lt;P&gt;input id 1-2 date $3-12 visit 14 ;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 2001-02-21 3 &lt;/P&gt;&lt;P&gt;1 2001-02-22 3 &lt;/P&gt;&lt;P&gt;2 2002-02-26 9 &lt;/P&gt;&lt;P&gt;3 2002-12-13 2 &lt;/P&gt;&lt;P&gt;3 2002-12-29 9 &lt;/P&gt;&lt;P&gt;4 2004-12-13 7 &lt;/P&gt;&lt;P&gt;4 2004-12-14 7 &lt;/P&gt;&lt;P&gt;4 2005-01-06 24&lt;/P&gt;&lt;P&gt;4 2005-01-07 24&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Criteria here &lt;/P&gt;&lt;P&gt;a)for first record same id, visit assign flag=1, when the visit is same for the same id, but the date change than increase the flag by 1. &lt;/P&gt;&lt;P&gt;b) when the first id and and second id observation is same, the visit is different and they are the first record for the the id assign flag to 1.&lt;/P&gt;&lt;P&gt;3) over all id falls in the same visit but changes can be seen on the data increment&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 23:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121194#M33410</guid>
      <dc:creator>tad</dc:creator>
      <dc:date>2013-08-23T23:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121195#M33411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the second example here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/faq/enumerate.htm" title="http://www.ats.ucla.edu/stat/sas/faq/enumerate.htm"&gt;SAS FAQ: How can I create an enumeration variable by groups?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2013 23:33:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121195#M33411</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-08-23T23:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121196#M33412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Above will not solve the problem , it will assign all the flag to 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Aug 2013 00:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121196#M33412</guid>
      <dc:creator>tad</dc:creator>
      <dc:date>2013-08-24T00:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121197#M33413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand correctly, if a subject had the same &lt;STRONG&gt;visit&lt;/STRONG&gt; and &lt;STRONG&gt;date&lt;/STRONG&gt; you wouldn't want &lt;STRONG&gt;output&lt;/STRONG&gt; to be increased by one. You could do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sort data=test; by id visit date; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data testOut;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;set test;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;by id visit date;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if first.visit &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then output = 1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else output + first.date;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print data=testOut noobs; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Aug 2013 01:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121197#M33413</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-08-24T01:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121198#M33414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just noticed something in that second idre example: the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if first.class or first.gender then count = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should be simply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if first.gender then count = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;since &lt;STRONG&gt;first.class&lt;/STRONG&gt; inplies &lt;STRONG&gt;first.gender&lt;/STRONG&gt; when data is sorted &lt;STRONG&gt;by class gender&lt;/STRONG&gt;. The result is the same of course, except for the poor student trying to learn about the workings of &lt;STRONG&gt;first.&lt;/STRONG&gt; and &lt;STRONG&gt;last.&lt;/STRONG&gt; &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Aug 2013 01:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121198#M33414</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-08-24T01:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121199#M33415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data test;&lt;BR /&gt;infile datalines dlm=' ' dsd;&lt;BR /&gt;format date date9.;&lt;BR /&gt;input id date :yymmdd10. visit ;&lt;BR /&gt;datalines;&lt;BR /&gt;1 2001-02-21 3&lt;BR /&gt;1 2001-02-22 3&lt;BR /&gt;2 2002-02-26 9&lt;BR /&gt;3 2002-12-13 2&lt;BR /&gt;3 2002-12-29 9&lt;BR /&gt;4 2004-12-13 7&lt;BR /&gt;4 2004-12-14 7&lt;BR /&gt;4 2005-01-06 24&lt;BR /&gt;4 2005-01-07 24&lt;BR /&gt;;&lt;BR /&gt;;;;;&lt;/P&gt;&lt;P&gt;/* do a precautionary sort */&lt;/P&gt;&lt;P&gt;proc sort data=test;&lt;BR /&gt;by id date visit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* process and set flag */&lt;/P&gt;&lt;P&gt;Data want ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set test;&lt;BR /&gt;&amp;nbsp; drop last_id last_visit ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by id date visit;&lt;BR /&gt;&amp;nbsp; last_id = lag1(id);&lt;BR /&gt;&amp;nbsp; last_visit = lag1(visit);&lt;BR /&gt;&amp;nbsp; if last_id = . then flag = 1;&lt;BR /&gt; else if id ^= last_id then flag = 1;&lt;BR /&gt; else if visit ^= last_visit then flag = 1 ;&lt;BR /&gt; else flag + 1 ;&lt;BR /&gt;run ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Aug 2013 01:56:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121199#M33415</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-24T01:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121200#M33416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="2746" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution is simpler and far more elegant than the one I posted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Aug 2013 01:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121200#M33416</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-24T01:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121201#M33417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might be useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data = test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by id&amp;nbsp;&amp;nbsp; visit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set test;&lt;/P&gt;&lt;P&gt;by id&amp;nbsp;&amp;nbsp; visit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if first.visit then flag=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag +1;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Aug 2013 05:17:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121201#M33417</guid>
      <dc:creator>Pallav</dc:creator>
      <dc:date>2013-08-24T05:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121202#M33418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; id visit;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; (first.id or first.visit) NE (last.id or last.visit) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; flag + &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; first.id or first.visit &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; flag = &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Urvish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 07:30:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121202#M33418</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-08-26T07:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121203#M33419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Orignial questions was answered but now i would like to add a twist here and introduce a new variable:&lt;/P&gt;&lt;P&gt;id date visit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output&lt;/P&gt;&lt;P&gt;1 2001-02-21 3 ---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;1 2001-02-22 3 ---------------&amp;gt;flag =2&lt;/P&gt;&lt;P&gt;2 2002-02-26 9 ---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;3 2002-12-13 2 ---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;3 2002-12-29 9 ---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2004-12-13 7 ----------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2004-12-14 7 -----------------&amp;gt;flag =2&lt;/P&gt;&lt;P&gt;4 2005-01-06 24 ------------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2005-01-07 24 ------------------&amp;gt;flag =2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) New variable introduced here test, so now here, for the same id, different date, same visit but same test would like to increment the flag, otherwise keep as flag 1&lt;/P&gt;&lt;P&gt;id date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output&lt;/P&gt;&lt;P&gt;1 2001-02-21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;3&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;1 2001-02-22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a---------------&amp;gt;flag =2&lt;/P&gt;&lt;P&gt;2 2002-02-26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a ---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;3 2002-12-13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;3 2002-12-29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a---------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2004-12-13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a----------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2004-12-14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b-----------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2005-01-06&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&amp;nbsp;&amp;nbsp;&amp;nbsp; a -----------------&amp;gt;flag =1&lt;/P&gt;&lt;P&gt;4 2005-01-07&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24&amp;nbsp;&amp;nbsp;&amp;nbsp; a------------------&amp;gt;flag =2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 18:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121203#M33419</guid>
      <dc:creator>tad</dc:creator>
      <dc:date>2013-08-28T18:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging a subject based on visit and it's corresponding dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121204#M33420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Play around with the by variable.&lt;/P&gt;&lt;P&gt;You probably want by id test date visit or something like that. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Aug 2013 18:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Flagging-a-subject-based-on-visit-and-it-s-corresponding-dates/m-p/121204#M33420</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-08-28T18:53:59Z</dc:date>
    </item>
  </channel>
</rss>

