<?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: Assignments of visit number based on date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assignments-of-visit-number-based-on-date/m-p/495839#M130961</link>
    <description>&lt;P&gt;a teaser fun i learned from genius PD's dazzle playing with&amp;nbsp; PDV . &lt;STRONG&gt;Don't use this&lt;/STRONG&gt;, but play with it. It's a joy as it gives an intuition of how DOW works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want1;
if 0 then set have;
visit=0;
do until(last.id);
visit+1;
do until(last.date);
set have;
by id date;
output;
end;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Sep 2018 22:33:02 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-09-14T22:33:02Z</dc:date>
    <item>
      <title>Assignments of visit number based on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assignments-of-visit-number-based-on-date/m-p/495831#M130956</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a relatively simple&amp;nbsp;task&amp;nbsp;I need some help with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to assign a visit # to assessments that were performed on different dates for the same subject ID. Does someone know how I&amp;nbsp;can generate this 3rd column called visit?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Visit&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;01/02/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;01/02/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;01/02/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;01/02/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;08/08/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;08/08/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;08/08/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;04/03/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;04/03/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;04/03/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;09/09/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;09/09/2018&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;etc.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I basically need to assign a visit number per date within each subject ID, but am struggling with the code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I look forward to your feedback!&lt;BR /&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 22:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assignments-of-visit-number-based-on-date/m-p/495831#M130956</guid>
      <dc:creator>abc44</dc:creator>
      <dc:date>2018-09-14T22:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Assignments of visit number based on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assignments-of-visit-number-based-on-date/m-p/495832#M130957</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by id date ;
if first.id then visit=1;
else if first.date then visit+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Sep 2018 22:12:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assignments-of-visit-number-based-on-date/m-p/495832#M130957</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-14T22:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Assignments of visit number based on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assignments-of-visit-number-based-on-date/m-p/495837#M130960</link>
      <description>&lt;P&gt;This works- thanks so much!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 22:29:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assignments-of-visit-number-based-on-date/m-p/495837#M130960</guid>
      <dc:creator>abc44</dc:creator>
      <dc:date>2018-09-14T22:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Assignments of visit number based on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assignments-of-visit-number-based-on-date/m-p/495839#M130961</link>
      <description>&lt;P&gt;a teaser fun i learned from genius PD's dazzle playing with&amp;nbsp; PDV . &lt;STRONG&gt;Don't use this&lt;/STRONG&gt;, but play with it. It's a joy as it gives an intuition of how DOW works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want1;
if 0 then set have;
visit=0;
do until(last.id);
visit+1;
do until(last.date);
set have;
by id date;
output;
end;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 22:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assignments-of-visit-number-based-on-date/m-p/495839#M130961</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-14T22:33:02Z</dc:date>
    </item>
  </channel>
</rss>

