<?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 HELP with longitundinal base programming - I have done this before but it's not working now. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480167#M124071</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help with some longitudinal programing which I have done before!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this time, after I assign first obs for counting observations, I get a weird result for id=55.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;I included the program here (I would not accept my sas files&amp;nbsp;-sorry).&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;- &lt;EM&gt;The&amp;nbsp;log says it all worked but I get the wrong results.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- I attached the database - I changed dates so there are no HIPAA violations&lt;/P&gt;&lt;P&gt;- At end, I attached the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sorry for a basic ? but i'm tired and have spend 2 days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;IT WILL NOT ALLOW ME TO ATTACH THE DATA. SO I WILL COPY IT HERE. IT'S KIND OF LONG.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp; OH, IS THERE ANY WAY TO LEFT JUSTIFY THE OUTPUT?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Program:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;HTML&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;close&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;listing&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* this is SAS printout */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;options&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; linesize=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;132&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; pagesize=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;60&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;center&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;date&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;options&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pageno=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;LIBNAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; help &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'C:\sas\a_study\post1help'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; library2 &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'c:\sas\a_study\post1help'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;fmtsearch&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=(library2);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;dm&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'out; clear; log; clear;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; one;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; help.onepost; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;contents&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;　&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; counts; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* gets me the total counts of visits for each person */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; help.onepost ; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;*found no duplicates;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp; by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; id;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; first.id=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; n_visits=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; n_visits + &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; last.id=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=counts; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;OUTPUT&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;TABLE border="0" cellspacing="1" cellpadding="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;The SAS System&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs id initial_hr_date test_hr_date prehr posthr n_visits1234 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;03/01/2018&lt;/TD&gt;&lt;TD&gt;03/02/2018&lt;/TD&gt;&lt;TD&gt;160&lt;/TD&gt;&lt;TD&gt;94&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;11/27/2017&lt;/TD&gt;&lt;TD&gt;11/28/2017&lt;/TD&gt;&lt;TD&gt;249&lt;/TD&gt;&lt;TD&gt;133&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;55&lt;/TD&gt;&lt;TD&gt;08/20/2010&lt;/TD&gt;&lt;TD&gt;08/23/2010&lt;/TD&gt;&lt;TD&gt;118&lt;/TD&gt;&lt;TD&gt;145&lt;/TD&gt;&lt;TD&gt;57&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;56&lt;/TD&gt;&lt;TD&gt;06/17/2010&lt;/TD&gt;&lt;TD&gt;06/18/2010&lt;/TD&gt;&lt;TD&gt;172&lt;/TD&gt;&lt;TD&gt;88&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#993300" face="Courier New" size="2"&gt;* Read the count (proc prints)&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color="#993300" face="Courier New" size="2"&gt;&lt;FONT color="#003366"&gt;Obs55 should be 4/30/10 for both dates!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;Notice how 55 does not have its original data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;The dates are mixed up and&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;the first obs should be 4/30/10;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;/*&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;Why does it change like that?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;The others don't. */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&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; * Read the count (proc prints)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&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; Notice how 55 does not have its original data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&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;&amp;nbsp; The dates are mixed up and&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&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;&amp;nbsp; the first obs should be 4/30/10;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;/*&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;Why does it change like that?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;The others don't. */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;THANKS!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obs&amp;nbsp; &amp;nbsp;id&amp;nbsp;&amp;nbsp;&amp;nbsp;initial_test_hr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr_date date&amp;nbsp;&amp;nbsp; prehr&amp;nbsp;&amp;nbsp; &amp;nbsp;posthr&lt;/P&gt;&lt;P&gt;1 1 01/30/2018 02/19/2018 135 105&lt;/P&gt;&lt;P&gt;2 1 02/19/2018 02/20/2018 162 83&lt;/P&gt;&lt;P&gt;3 1 02/20/2018 02/21/2018 198 94&lt;/P&gt;&lt;P&gt;4 1 02/21/2018 02/22/2018 184 99&lt;/P&gt;&lt;P&gt;5 1 02/22/2018 02/23/2018 153 105&lt;/P&gt;&lt;P&gt;6 1 02/23/2018 02/26/2018 161 127&lt;/P&gt;&lt;P&gt;7 1 02/26/2018 02/27/2018 134 148&lt;/P&gt;&lt;P&gt;8 1 02/27/2018 02/28/2018 174 129&lt;/P&gt;&lt;P&gt;9 1 02/28/2018 03/01/2018 206 152&lt;/P&gt;&lt;P&gt;10 1 03/01/2018 03/02/2018 160 94&lt;/P&gt;&lt;P&gt;11 3 10/05/2017 10/30/2017 137 160&lt;/P&gt;&lt;P&gt;12 3 10/30/2017 10/31/2017 162 109&lt;/P&gt;&lt;P&gt;13 3 10/31/2017 11/01/2017 305 176&lt;/P&gt;&lt;P&gt;14 3 11/01/2017 11/02/2017 207 211&lt;/P&gt;&lt;P&gt;15 3 11/02/2017 11/03/2017 175 96&lt;/P&gt;&lt;P&gt;16 3 11/03/2017 11/06/2017 145 78&lt;/P&gt;&lt;P&gt;17 3 11/06/2017 11/07/2017 172 175&lt;/P&gt;&lt;P&gt;18 3 11/07/2017 11/08/2017 186 95&lt;/P&gt;&lt;P&gt;19 3 11/08/2017 11/09/2017 261 173&lt;/P&gt;&lt;P&gt;20 3 11/09/2017 11/10/2017 148 118&lt;/P&gt;&lt;P&gt;21 3 11/10/2017 11/13/2017 166 134&lt;/P&gt;&lt;P&gt;22 3 11/13/2017 11/14/2017 197 157&lt;/P&gt;&lt;P&gt;23 3 11/14/2017 11/15/2017 351 162&lt;/P&gt;&lt;P&gt;24 3 11/15/2017 11/16/2017 231 100&lt;/P&gt;&lt;P&gt;25 3 11/16/2017 11/17/2017 235 100&lt;/P&gt;&lt;P&gt;26 3 11/17/2017 11/20/2017 126 88&lt;/P&gt;&lt;P&gt;27 3 11/20/2017 11/21/2017 144 113&lt;/P&gt;&lt;P&gt;28 3 11/21/2017 11/22/2017 241 268&lt;/P&gt;&lt;P&gt;29 3 11/22/2017 11/27/2017 129 153&lt;/P&gt;&lt;P&gt;30 3 11/27/2017 11/28/2017 249 133&lt;/P&gt;&lt;P&gt;31 55 04/20/2012 04/20/2010 154 128&lt;/P&gt;&lt;P&gt;32 55 04/20/2010 05/10/2010 164 113&lt;/P&gt;&lt;P&gt;33 55 05/10/2010 05/11/2010 135 107&lt;/P&gt;&lt;P&gt;34 55 05/11/2010 05/12/2010 138 112&lt;/P&gt;&lt;P&gt;35 55 05/12/2010 05/13/2010 109 119&lt;/P&gt;&lt;P&gt;36 55 05/13/2010 05/14/2010 155 107&lt;/P&gt;&lt;P&gt;37 55 05/14/2010 05/19/2010 189 149&lt;/P&gt;&lt;P&gt;38 55 05/19/2010 05/21/2010 235 138&lt;/P&gt;&lt;P&gt;39 55 05/21/2010 05/24/2010 190 201&lt;/P&gt;&lt;P&gt;40 55 05/24/2010 05/25/2010 181 116&lt;/P&gt;&lt;P&gt;41 55 05/25/2010 05/26/2010 190 165&lt;/P&gt;&lt;P&gt;42 55 05/26/2010 05/27/2010 177 170&lt;/P&gt;&lt;P&gt;43 55 05/27/2010 05/28/2010 158 111&lt;/P&gt;&lt;P&gt;44 55 05/28/2010 06/01/2010 188 116&lt;/P&gt;&lt;P&gt;45 55 06/01/2010 06/02/2010 230 100&lt;/P&gt;&lt;P&gt;46 55 06/02/2010 06/08/2010 127 120&lt;/P&gt;&lt;P&gt;47 55 06/08/2010 06/09/2010 187 132&lt;/P&gt;&lt;P&gt;48 55 06/09/2010 06/10/2010 196 167&lt;/P&gt;&lt;P&gt;49 55 06/10/2010 06/11/2010 193 149&lt;/P&gt;&lt;P&gt;50 55 06/11/2010 06/15/2010 150 81&lt;/P&gt;&lt;P&gt;51 55 06/15/2010 06/16/2010 165 119&lt;/P&gt;&lt;P&gt;52 55 06/16/2010 06/17/2010 172 128&lt;/P&gt;&lt;P&gt;53 55 06/17/2010 06/18/2010 105 123&lt;/P&gt;&lt;P&gt;54 55 06/18/2010 06/21/2010 208 107&lt;/P&gt;&lt;P&gt;55 55 06/21/2010 06/22/2010 163 85&lt;/P&gt;&lt;P&gt;56 55 06/22/2010 06/23/2010 180 98&lt;/P&gt;&lt;P&gt;57 55 06/23/2010 06/24/2010 196 81&lt;/P&gt;&lt;P&gt;58 55 06/24/2010 06/25/2010 202 118&lt;/P&gt;&lt;P&gt;59 55 06/25/2010 06/29/2010 183 85&lt;/P&gt;&lt;P&gt;60 55 06/29/2010 06/30/2010 181 147&lt;/P&gt;&lt;P&gt;61 55 06/30/2010 07/01/2010 151 119&lt;/P&gt;&lt;P&gt;62 55 07/01/2010 07/02/2010 184 154&lt;/P&gt;&lt;P&gt;63 55 07/02/2010 07/06/2010 199 93&lt;/P&gt;&lt;P&gt;64 55 07/06/2010 07/08/2010 191 101&lt;/P&gt;&lt;P&gt;65 55 07/08/2010 07/09/2010 187 94&lt;/P&gt;&lt;P&gt;66 55 07/09/2010 07/12/2010 36 156&lt;/P&gt;&lt;P&gt;67 55 07/12/2010 07/13/2010 146 96&lt;/P&gt;&lt;P&gt;68 55 07/13/2010 07/19/2010 267 130&lt;/P&gt;&lt;P&gt;69 55 07/19/2010 07/21/2010 152 99&lt;/P&gt;&lt;P&gt;70 55 07/21/2010 07/23/2010 265 104&lt;/P&gt;&lt;P&gt;71 55 07/23/2010 07/26/2010 164 158&lt;/P&gt;&lt;P&gt;72 55 07/26/2010 07/27/2010 181 93&lt;/P&gt;&lt;P&gt;73 55 07/27/2010 07/28/2010 250 111&lt;/P&gt;&lt;P&gt;74 55 07/28/2010 07/30/2010 251 104&lt;/P&gt;&lt;P&gt;75 55 07/30/2010 08/03/2010 178 125&lt;/P&gt;&lt;P&gt;76 55 08/03/2010 08/04/2010 224 93&lt;/P&gt;&lt;P&gt;77 55 08/04/2010 08/05/2010 195 145&lt;/P&gt;&lt;P&gt;78 55 08/05/2010 08/06/2010 246 123&lt;/P&gt;&lt;P&gt;79 55 08/06/2010 08/10/2010 155 121&lt;/P&gt;&lt;P&gt;80 55 08/10/2010 08/11/2010 307 91&lt;/P&gt;&lt;P&gt;81 55 08/11/2010 08/12/2010 179 106&lt;/P&gt;&lt;P&gt;82 55 08/12/2010 08/13/2010 258 207&lt;/P&gt;&lt;P&gt;83 55 08/13/2010 08/16/2010 198 77&lt;/P&gt;&lt;P&gt;84 55 08/16/2010 08/17/2010 208 123&lt;/P&gt;&lt;P&gt;85 55 08/17/2010 08/19/2010 225 155&lt;/P&gt;&lt;P&gt;86 55 08/19/2010 08/20/2010 206 115&lt;/P&gt;&lt;P&gt;87 55 08/20/2010 08/23/2010 118 145&lt;/P&gt;&lt;P&gt;88 56 06/01/2010 06/09/2010 151 91&lt;/P&gt;&lt;P&gt;89 56 06/09/2010 06/10/2010 189 108&lt;/P&gt;&lt;P&gt;90 56 06/10/2010 06/15/2010 156 94&lt;/P&gt;&lt;P&gt;91 56 06/15/2010 06/16/2010 162 107&lt;/P&gt;&lt;P&gt;92 56 06/16/2010 06/17/2010 183 116&lt;/P&gt;&lt;P&gt;93 56 06/17/2010 06/18/2010 172 88&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 21 Jul 2018 17:47:47 GMT</pubDate>
    <dc:creator>mgrzyb</dc:creator>
    <dc:date>2018-07-21T17:47:47Z</dc:date>
    <item>
      <title>HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480167#M124071</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help with some longitudinal programing which I have done before!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this time, after I assign first obs for counting observations, I get a weird result for id=55.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;I included the program here (I would not accept my sas files&amp;nbsp;-sorry).&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;- &lt;EM&gt;The&amp;nbsp;log says it all worked but I get the wrong results.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;- I attached the database - I changed dates so there are no HIPAA violations&lt;/P&gt;&lt;P&gt;- At end, I attached the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sorry for a basic ? but i'm tired and have spend 2 days.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;IT WILL NOT ALLOW ME TO ATTACH THE DATA. SO I WILL COPY IT HERE. IT'S KIND OF LONG.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp; OH, IS THERE ANY WAY TO LEFT JUSTIFY THE OUTPUT?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Program:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;HTML&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;close&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;listing&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* this is SAS printout */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;options&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; linesize=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;132&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; pagesize=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;60&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;center&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;date&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;options&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; pageno=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;LIBNAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; help &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'C:\sas\a_study\post1help'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; library2 &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'c:\sas\a_study\post1help'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;options&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;fmtsearch&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=(library2);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;dm&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'out; clear; log; clear;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; one;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; help.onepost; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;contents&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;　&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; counts; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* gets me the total counts of visits for each person */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; help.onepost ; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;*found no duplicates;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp; by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; id;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; first.id=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; n_visits=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; n_visits + &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; last.id=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=counts; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;OUTPUT&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;TABLE border="0" cellspacing="1" cellpadding="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;The SAS System&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs id initial_hr_date test_hr_date prehr posthr n_visits1234 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;03/01/2018&lt;/TD&gt;&lt;TD&gt;03/02/2018&lt;/TD&gt;&lt;TD&gt;160&lt;/TD&gt;&lt;TD&gt;94&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;11/27/2017&lt;/TD&gt;&lt;TD&gt;11/28/2017&lt;/TD&gt;&lt;TD&gt;249&lt;/TD&gt;&lt;TD&gt;133&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;55&lt;/TD&gt;&lt;TD&gt;08/20/2010&lt;/TD&gt;&lt;TD&gt;08/23/2010&lt;/TD&gt;&lt;TD&gt;118&lt;/TD&gt;&lt;TD&gt;145&lt;/TD&gt;&lt;TD&gt;57&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;56&lt;/TD&gt;&lt;TD&gt;06/17/2010&lt;/TD&gt;&lt;TD&gt;06/18/2010&lt;/TD&gt;&lt;TD&gt;172&lt;/TD&gt;&lt;TD&gt;88&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#993300" face="Courier New" size="2"&gt;* Read the count (proc prints)&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color="#993300" face="Courier New" size="2"&gt;&lt;FONT color="#003366"&gt;Obs55 should be 4/30/10 for both dates!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;Notice how 55 does not have its original data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;The dates are mixed up and&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;the first obs should be 4/30/10;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;/*&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;Why does it change like that?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;The others don't. */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&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; * Read the count (proc prints)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&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; Notice how 55 does not have its original data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&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;&amp;nbsp; The dates are mixed up and&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&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;&amp;nbsp; the first obs should be 4/30/10;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;/*&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;Why does it change like that?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;The others don't. */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;THANKS!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obs&amp;nbsp; &amp;nbsp;id&amp;nbsp;&amp;nbsp;&amp;nbsp;initial_test_hr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hr_date date&amp;nbsp;&amp;nbsp; prehr&amp;nbsp;&amp;nbsp; &amp;nbsp;posthr&lt;/P&gt;&lt;P&gt;1 1 01/30/2018 02/19/2018 135 105&lt;/P&gt;&lt;P&gt;2 1 02/19/2018 02/20/2018 162 83&lt;/P&gt;&lt;P&gt;3 1 02/20/2018 02/21/2018 198 94&lt;/P&gt;&lt;P&gt;4 1 02/21/2018 02/22/2018 184 99&lt;/P&gt;&lt;P&gt;5 1 02/22/2018 02/23/2018 153 105&lt;/P&gt;&lt;P&gt;6 1 02/23/2018 02/26/2018 161 127&lt;/P&gt;&lt;P&gt;7 1 02/26/2018 02/27/2018 134 148&lt;/P&gt;&lt;P&gt;8 1 02/27/2018 02/28/2018 174 129&lt;/P&gt;&lt;P&gt;9 1 02/28/2018 03/01/2018 206 152&lt;/P&gt;&lt;P&gt;10 1 03/01/2018 03/02/2018 160 94&lt;/P&gt;&lt;P&gt;11 3 10/05/2017 10/30/2017 137 160&lt;/P&gt;&lt;P&gt;12 3 10/30/2017 10/31/2017 162 109&lt;/P&gt;&lt;P&gt;13 3 10/31/2017 11/01/2017 305 176&lt;/P&gt;&lt;P&gt;14 3 11/01/2017 11/02/2017 207 211&lt;/P&gt;&lt;P&gt;15 3 11/02/2017 11/03/2017 175 96&lt;/P&gt;&lt;P&gt;16 3 11/03/2017 11/06/2017 145 78&lt;/P&gt;&lt;P&gt;17 3 11/06/2017 11/07/2017 172 175&lt;/P&gt;&lt;P&gt;18 3 11/07/2017 11/08/2017 186 95&lt;/P&gt;&lt;P&gt;19 3 11/08/2017 11/09/2017 261 173&lt;/P&gt;&lt;P&gt;20 3 11/09/2017 11/10/2017 148 118&lt;/P&gt;&lt;P&gt;21 3 11/10/2017 11/13/2017 166 134&lt;/P&gt;&lt;P&gt;22 3 11/13/2017 11/14/2017 197 157&lt;/P&gt;&lt;P&gt;23 3 11/14/2017 11/15/2017 351 162&lt;/P&gt;&lt;P&gt;24 3 11/15/2017 11/16/2017 231 100&lt;/P&gt;&lt;P&gt;25 3 11/16/2017 11/17/2017 235 100&lt;/P&gt;&lt;P&gt;26 3 11/17/2017 11/20/2017 126 88&lt;/P&gt;&lt;P&gt;27 3 11/20/2017 11/21/2017 144 113&lt;/P&gt;&lt;P&gt;28 3 11/21/2017 11/22/2017 241 268&lt;/P&gt;&lt;P&gt;29 3 11/22/2017 11/27/2017 129 153&lt;/P&gt;&lt;P&gt;30 3 11/27/2017 11/28/2017 249 133&lt;/P&gt;&lt;P&gt;31 55 04/20/2012 04/20/2010 154 128&lt;/P&gt;&lt;P&gt;32 55 04/20/2010 05/10/2010 164 113&lt;/P&gt;&lt;P&gt;33 55 05/10/2010 05/11/2010 135 107&lt;/P&gt;&lt;P&gt;34 55 05/11/2010 05/12/2010 138 112&lt;/P&gt;&lt;P&gt;35 55 05/12/2010 05/13/2010 109 119&lt;/P&gt;&lt;P&gt;36 55 05/13/2010 05/14/2010 155 107&lt;/P&gt;&lt;P&gt;37 55 05/14/2010 05/19/2010 189 149&lt;/P&gt;&lt;P&gt;38 55 05/19/2010 05/21/2010 235 138&lt;/P&gt;&lt;P&gt;39 55 05/21/2010 05/24/2010 190 201&lt;/P&gt;&lt;P&gt;40 55 05/24/2010 05/25/2010 181 116&lt;/P&gt;&lt;P&gt;41 55 05/25/2010 05/26/2010 190 165&lt;/P&gt;&lt;P&gt;42 55 05/26/2010 05/27/2010 177 170&lt;/P&gt;&lt;P&gt;43 55 05/27/2010 05/28/2010 158 111&lt;/P&gt;&lt;P&gt;44 55 05/28/2010 06/01/2010 188 116&lt;/P&gt;&lt;P&gt;45 55 06/01/2010 06/02/2010 230 100&lt;/P&gt;&lt;P&gt;46 55 06/02/2010 06/08/2010 127 120&lt;/P&gt;&lt;P&gt;47 55 06/08/2010 06/09/2010 187 132&lt;/P&gt;&lt;P&gt;48 55 06/09/2010 06/10/2010 196 167&lt;/P&gt;&lt;P&gt;49 55 06/10/2010 06/11/2010 193 149&lt;/P&gt;&lt;P&gt;50 55 06/11/2010 06/15/2010 150 81&lt;/P&gt;&lt;P&gt;51 55 06/15/2010 06/16/2010 165 119&lt;/P&gt;&lt;P&gt;52 55 06/16/2010 06/17/2010 172 128&lt;/P&gt;&lt;P&gt;53 55 06/17/2010 06/18/2010 105 123&lt;/P&gt;&lt;P&gt;54 55 06/18/2010 06/21/2010 208 107&lt;/P&gt;&lt;P&gt;55 55 06/21/2010 06/22/2010 163 85&lt;/P&gt;&lt;P&gt;56 55 06/22/2010 06/23/2010 180 98&lt;/P&gt;&lt;P&gt;57 55 06/23/2010 06/24/2010 196 81&lt;/P&gt;&lt;P&gt;58 55 06/24/2010 06/25/2010 202 118&lt;/P&gt;&lt;P&gt;59 55 06/25/2010 06/29/2010 183 85&lt;/P&gt;&lt;P&gt;60 55 06/29/2010 06/30/2010 181 147&lt;/P&gt;&lt;P&gt;61 55 06/30/2010 07/01/2010 151 119&lt;/P&gt;&lt;P&gt;62 55 07/01/2010 07/02/2010 184 154&lt;/P&gt;&lt;P&gt;63 55 07/02/2010 07/06/2010 199 93&lt;/P&gt;&lt;P&gt;64 55 07/06/2010 07/08/2010 191 101&lt;/P&gt;&lt;P&gt;65 55 07/08/2010 07/09/2010 187 94&lt;/P&gt;&lt;P&gt;66 55 07/09/2010 07/12/2010 36 156&lt;/P&gt;&lt;P&gt;67 55 07/12/2010 07/13/2010 146 96&lt;/P&gt;&lt;P&gt;68 55 07/13/2010 07/19/2010 267 130&lt;/P&gt;&lt;P&gt;69 55 07/19/2010 07/21/2010 152 99&lt;/P&gt;&lt;P&gt;70 55 07/21/2010 07/23/2010 265 104&lt;/P&gt;&lt;P&gt;71 55 07/23/2010 07/26/2010 164 158&lt;/P&gt;&lt;P&gt;72 55 07/26/2010 07/27/2010 181 93&lt;/P&gt;&lt;P&gt;73 55 07/27/2010 07/28/2010 250 111&lt;/P&gt;&lt;P&gt;74 55 07/28/2010 07/30/2010 251 104&lt;/P&gt;&lt;P&gt;75 55 07/30/2010 08/03/2010 178 125&lt;/P&gt;&lt;P&gt;76 55 08/03/2010 08/04/2010 224 93&lt;/P&gt;&lt;P&gt;77 55 08/04/2010 08/05/2010 195 145&lt;/P&gt;&lt;P&gt;78 55 08/05/2010 08/06/2010 246 123&lt;/P&gt;&lt;P&gt;79 55 08/06/2010 08/10/2010 155 121&lt;/P&gt;&lt;P&gt;80 55 08/10/2010 08/11/2010 307 91&lt;/P&gt;&lt;P&gt;81 55 08/11/2010 08/12/2010 179 106&lt;/P&gt;&lt;P&gt;82 55 08/12/2010 08/13/2010 258 207&lt;/P&gt;&lt;P&gt;83 55 08/13/2010 08/16/2010 198 77&lt;/P&gt;&lt;P&gt;84 55 08/16/2010 08/17/2010 208 123&lt;/P&gt;&lt;P&gt;85 55 08/17/2010 08/19/2010 225 155&lt;/P&gt;&lt;P&gt;86 55 08/19/2010 08/20/2010 206 115&lt;/P&gt;&lt;P&gt;87 55 08/20/2010 08/23/2010 118 145&lt;/P&gt;&lt;P&gt;88 56 06/01/2010 06/09/2010 151 91&lt;/P&gt;&lt;P&gt;89 56 06/09/2010 06/10/2010 189 108&lt;/P&gt;&lt;P&gt;90 56 06/10/2010 06/15/2010 156 94&lt;/P&gt;&lt;P&gt;91 56 06/15/2010 06/16/2010 162 107&lt;/P&gt;&lt;P&gt;92 56 06/16/2010 06/17/2010 183 116&lt;/P&gt;&lt;P&gt;93 56 06/17/2010 06/18/2010 172 88&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 17:47:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480167#M124071</guid>
      <dc:creator>mgrzyb</dc:creator>
      <dc:date>2018-07-21T17:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480171#M124075</link>
      <description>&lt;P&gt;I see no problem. You get all 4 variable values from obs 87 of onepost, and the correct count of 57 (obs 31 to 87).&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 18:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480171#M124075</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-21T18:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480177#M124076</link>
      <description>&lt;P&gt;I think I send the wrong part of the dataset for id=55. let me look again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 18:57:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480177#M124076</guid>
      <dc:creator>mgrzyb</dc:creator>
      <dc:date>2018-07-21T18:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480179#M124077</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;I posted the wrong data but the right out put.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;If you notice id=55, the 1st visitnumber should be that where there is 4/20/10 and 4/20/10.&amp;nbsp; And it is not.&amp;nbsp; I copied it on a word document this time. &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;Feel free to test my program and see what you get. &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;I can't get the 1st visit to be the 1st observation for id 55, which should be 4/20/10 and 4/20/10.&amp;nbsp; That person had the 1st initial consult on 4/20/10 and went to the treatment to treat the heart rate the same day.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" size="4"&gt;I APOLOGIZE greatly if I got the data mixed up.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" size="4"&gt;But this is the correct data here.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;It is in excel. I hope it attaches. I don't know how to make these things attach. I tried everything!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 19:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480179#M124077</guid>
      <dc:creator>mgrzyb</dc:creator>
      <dc:date>2018-07-21T19:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480180#M124078</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;I have to take a nap.&amp;nbsp; I am so tired.&amp;nbsp; Please help me.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 19:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480180#M124078</guid>
      <dc:creator>mgrzyb</dc:creator>
      <dc:date>2018-07-21T19:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480185#M124079</link>
      <description>&lt;P&gt;You mentioned DATES but your posted code is doing NOTHING with the date variables.&amp;nbsp; What do you want to do with the date variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume that in addition to counting observations you want to find the first and the last date per ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set help.onepost ; 
  by id date ;
  retain n_visits first_date ;
  format first_date last_date date9. ;
  if first.id then n_visits=0;
  if first.id then first_date = date ;
  n_visits + 1;
  if last.id ;
  last_date = date ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Make sure that your retained variable (N_VISITS and FIRST_DATE) are NOT already on the input dataset.&amp;nbsp; If they are then either use different variable names or add the DROP= dataset option to the SET statement so the old variables are not read into the current step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS Learn to use the tools on the Forum editor menu to paste text, programs and images.&amp;nbsp; This will make your postings easier to read.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 375px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21902i4ECEDD8E48C09E8F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 21:09:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480185#M124079</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-21T21:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480215#M124090</link>
      <description>Thxs. I’ll check it out later tonight.&lt;BR /&gt;</description>
      <pubDate>Sun, 22 Jul 2018 07:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480215#M124090</guid>
      <dc:creator>mgrzyb</dc:creator>
      <dc:date>2018-07-22T07:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480420#M124168</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested your code. I do not understand the date comment.&amp;nbsp; I have:&lt;/P&gt;&lt;P&gt;initial_hr_date and&amp;nbsp;test_hr_date.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It gets stuck when sorting by id date &amp;nbsp; - I hv no date variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to change initial_hr_date to firstdate and test_hr_date to last_date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you write it out? I am so confused.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480420#M124168</guid>
      <dc:creator>katemcguckin</dc:creator>
      <dc:date>2018-07-23T13:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480429#M124172</link>
      <description>&lt;P&gt;Tom, I get this in my log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;BY variable date is not on input data set HELP.ONEPOST.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:35:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480429#M124172</guid>
      <dc:creator>katemcguckin</dc:creator>
      <dc:date>2018-07-23T13:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480435#M124175</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221397"&gt;@katemcguckin&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Tom, I get this in my log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;BY variable date is not on input data set HELP.ONEPOST.&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want code that has been tested against real SAS data, you have to post such. Excel spreadsheets are useless for this. They only leave us guessing how your SAS datasets&amp;nbsp;&lt;EM&gt;might&lt;/EM&gt; look.&lt;/P&gt;
&lt;P&gt;Post data in a data step with datalines, and we have something to work with.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480435#M124175</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-23T13:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480495#M124195</link>
      <description>&lt;P&gt;Adapt the concepts to your data.&amp;nbsp; You seem to have two date variables.&amp;nbsp; What do you want to do with them?&amp;nbsp; If you do nothing, like in your original post, then you will output the values that are on the last observation for the group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 15:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480495#M124195</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-23T15:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: HELP with longitundinal base programming - I have done this before but it's not working now.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480534#M124204</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You know. It dawned on me when I use the long data and program it, it's all ok. &amp;nbsp; I think I confused myself so much. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to know tge days between treatmeants time from 1st visit to last visit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did those using code from Cody's book.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sorry I bothered you.&amp;nbsp; I sometimes over think and confuse myself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your time, though!&amp;nbsp; I am sorry.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 17:07:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-with-longitundinal-base-programming-I-have-done-this-before/m-p/480534#M124204</guid>
      <dc:creator>katemcguckin</dc:creator>
      <dc:date>2018-07-23T17:07:57Z</dc:date>
    </item>
  </channel>
</rss>

