<?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: Visit Numbers for Unscheduled Visits in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/282607#M59194</link>
    <description>&lt;P&gt;Really helpful! But could you please explain more detailed of the code? I can hardly understand the logic very clearly. Thanks. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jul 2016 03:58:58 GMT</pubDate>
    <dc:creator>Emily_Zhang</dc:creator>
    <dc:date>2016-07-07T03:58:58Z</dc:date>
    <item>
      <title>Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172736#M44501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;How do I derive vist numbers for unsheduled labs. If an unsheduled lab happens between visit 1 and visit 2 then visit number for that unscheduled visit shoud be 1.1 and if there are 2 unscheduled visits between visit 1 and visit 2, then first unscheduled visit should be 1.1 and second unscheduled visit should be 1.2. and so on.. The following in the sample data. Column VISITNUM should be derived.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks in advance.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="568"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="21" width="55"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Subject&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="140"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;LBCAT&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="57"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;LBTEST&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="70"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;LBDTC&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="166"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;VISIT&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="80"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;VISITNUM&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-weight: inherit; font-style: inherit;"&gt;&lt;TD class="xl65" height="35" style="border-top: none; font-style: inherit;" width="55"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;10-Jan-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Screening&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-weight: inherit; font-style: inherit;"&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;10-Mar-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Baseline&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-weight: inherit; font-style: inherit;"&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;15-Mar-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Unscheduled&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;1.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-weight: inherit; font-style: inherit;"&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;1-Apr-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Unscheduled&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-weight: inherit; font-style: inherit;"&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;10-Apr-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Month 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="font-weight: inherit; font-style: inherit;"&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;100&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;10-May-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Month 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;101&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;11-Jan-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Screening&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;101&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;10-Feb-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Baseline&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;101&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;15-Mar-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Unscheduled&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;101&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;1-Apr-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Unscheduled&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;2.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;101&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;10-Apr-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Month 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;2.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="21" style="border-top: none; font-style: inherit;" width="55"&gt;101&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="140"&gt;hematology&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="57"&gt;RBC&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; font-style: inherit;" width="70"&gt;10-May-11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="166"&gt;Month 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none; font-style: inherit;" width="80"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 13:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172736#M44501</guid>
      <dc:creator>Almighty</dc:creator>
      <dc:date>2014-07-09T13:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172737#M44502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, that depends on what you specs/team tell you.&amp;nbsp; If it is just sort by date (and what if there are multiple on the same date?), then sort the dataset, retain lstvisit and lstunsch, if unscheduled then visit=lstvisit + lstunsch.&amp;nbsp; It could however be far more complicated than that with applied logic defining visit windows, or other known patterns. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code for the above:&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 subjid;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain lstvisit lstunsch;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.subjid then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lstvisit=visit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lstunsch=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if type="UNSCHEDULED" then do;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lstunsch=lstunsch+0.1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* note I would recommend using 0.01 as there may be more than 10 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visit=lstvisit + lstunsch;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else lstvisit=visit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 14:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172737#M44502</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-09T14:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172738#M44503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your narrative and your example don't match.&amp;nbsp; Please restate more precisely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subject 101 on 15Mar and 10Apr do not follow the pattern in the narrative.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 14:28:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172738#M44503</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2014-07-09T14:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172739#M44504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RW9, I am working on a HW exercise similar to the OP. The solution you posted only partialy worked for me, SAS produces the vector lstvist such that if visit is (1, 2, ., .,3, ., 4) then lstvisit is (1, 2, 2, 2, 3, 3, 4), which is a step in the right direction. However, the lstunsch produces a vector of missing values. I have been trying to debug for a while but have had little success,&amp;nbsp; any chance you might know what is going on there? Also, I am assuming that your use of "visit" refers to the OP's use of&amp;nbsp; "visitnum", and "type" refers to&amp;nbsp; "visit".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kevin Adams&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Nov 2014 14:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172739#M44504</guid>
      <dc:creator>k6adams</dc:creator>
      <dc:date>2014-11-01T14:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172740#M44505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this solution should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA new;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set old;&lt;/P&gt;&lt;P&gt;&amp;nbsp; By subjid;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Retain visit_r 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If first.subjid Then visit_r = visitnum;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If visit = "Unscheduled" Then visitnum = visit_r + 0.01;&lt;/P&gt;&lt;P&gt;&amp;nbsp; visit_r = visitnum;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Drop visit_r;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a similar example see &lt;A href="http://www.mwsug.org/proceedings/2009/stats/MWSUG-2009-D14.pdf" title="http://www.mwsug.org/proceedings/2009/stats/MWSUG-2009-D14.pdf"&gt;http://www.mwsug.org/proceedings/2009/stats/MWSUG-2009-D14.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Nov 2014 15:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172740#M44505</guid>
      <dc:creator>k6adams</dc:creator>
      <dc:date>2014-11-01T15:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172741#M44506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keep it simple:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;by subject;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if first.subject then visitnum = -1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;visitnum + 0.1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if VISIT ne "Unscheduled" then visitnum = ceil(visitnum);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;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>Sun, 02 Nov 2014 03:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/172741#M44506</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-11-02T03:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/282607#M59194</link>
      <description>&lt;P&gt;Really helpful! But could you please explain more detailed of the code? I can hardly understand the logic very clearly. Thanks. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 03:58:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/282607#M59194</guid>
      <dc:creator>Emily_Zhang</dc:creator>
      <dc:date>2016-07-07T03:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/282608#M59195</link>
      <description>&lt;P&gt;Really helpful. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 04:00:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/282608#M59195</guid>
      <dc:creator>Emily_Zhang</dc:creator>
      <dc:date>2016-07-07T04:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/463267#M70458</link>
      <description>&lt;P&gt;Hi i have one more qus for you. in case&amp;nbsp;&lt;SPAN&gt;Unscheduled visit have&amp;nbsp; in same date 15-mar-11&amp;nbsp; in your data set present only one Unscheduled visit on that day&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;EX;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LBDTC&amp;nbsp; &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;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;15-Mar-11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Unscheduled&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;15-Mar-11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Unscheduled&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;15-Mar-11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Unscheduled&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;above the data is given i want visitno add 1.1 all three subjects how to do remaining&amp;nbsp; after the date as taken 1.2&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2018 10:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/463267#M70458</guid>
      <dc:creator>teja5959</dc:creator>
      <dc:date>2018-05-18T10:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Visit Numbers for Unscheduled Visits</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/463607#M70476</link>
      <description>&lt;P&gt;If you want all unscheduled visits on a single day&amp;nbsp; to have the same visit number,then change 2 lines of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;'s code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;change&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BY SUBJECT&lt;/P&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BY SUBJECT LBDTC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and change&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VISITNUM+1&lt;BR /&gt;to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF FIRST.LBDTC THEN VISITNUM+1;&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 04:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Visit-Numbers-for-Unscheduled-Visits/m-p/463607#M70476</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-05-20T04:57:54Z</dc:date>
    </item>
  </channel>
</rss>

