<?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: How can I create a variable for number of days spend in the study using the dates of examination in All Things Community</title>
    <link>https://communities.sas.com/t5/All-Things-Community/How-can-I-create-a-variable-for-number-of-days-spend-in-the/m-p/376578#M2589</link>
    <description>&lt;P&gt;Convert your dates into SAS dates. That way you can subtract any two dates to get the number of days elapsed. e.g.:&lt;/P&gt;
&lt;PRE&gt;data want;
  set finished;
  date=input(put(date,8.),yymmdd8.);
  format date date9.;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2017 14:46:28 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-07-17T14:46:28Z</dc:date>
    <item>
      <title>How can I create a variable for number of days spend in the study using the dates of examination</title>
      <link>https://communities.sas.com/t5/All-Things-Community/How-can-I-create-a-variable-for-number-of-days-spend-in-the/m-p/376571#M2588</link>
      <description>&lt;DIV class="lia-message-heading lia-component-message-header"&gt;&lt;DIV class="lia-quilt-row lia-quilt-row-standard"&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-left"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;&lt;DIV class="lia-message-subject"&gt;&lt;BR /&gt;&lt;DIV class="MessageReadByModeratorCell lia-moderation-moderated"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hello Community,&lt;BR /&gt;&lt;BR /&gt;I want to create a variable containing the days each person was followed up in the study using one date as the reference start date/study commencement date. There is a variable in my data set which has dates on which the participants were examined first and dates for the follow up examinations. The variable which has the dates on which measurements were taken has dates entered in format like this "20050101" which represents the year=2005, month=january and day=1st day of the month.&lt;BR /&gt;The data has five years of follow up but each person entered the study at different dates and different numbers of hospital visits.&lt;BR /&gt;&lt;BR /&gt;I want to create a variable having number of days each person was followed up and for each visit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data finished;&lt;BR /&gt;input id Date diagnosis @;&lt;BR /&gt;datalines;&lt;BR /&gt;1 20050101 &amp;nbsp;0&lt;BR /&gt;1 20050502 &amp;nbsp;0&lt;BR /&gt;1 20070708 &amp;nbsp;0&lt;BR /&gt;1 20090306 &amp;nbsp;0&lt;BR /&gt;2 20070608 &amp;nbsp;0&lt;BR /&gt;2 20090502 &amp;nbsp;1&lt;BR /&gt;2 20090805 &amp;nbsp;1&lt;BR /&gt;2 20090703 &amp;nbsp;1&lt;BR /&gt;2 20100507 &amp;nbsp;0&lt;BR /&gt;3 20050101 &amp;nbsp;0&lt;BR /&gt;3 20050502 &amp;nbsp;0&lt;BR /&gt;3 20070708 &amp;nbsp;0&lt;BR /&gt;3 20090306 &amp;nbsp;0&lt;BR /&gt;3 20070608 &amp;nbsp;0&lt;BR /&gt;4 20060502 &amp;nbsp;1&lt;BR /&gt;4 20090205 &amp;nbsp;0&lt;BR /&gt;4 20090403 &amp;nbsp;1&lt;BR /&gt;4 20100907 &amp;nbsp;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can i create a time variable in days for these repeated measurements?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried different codes but they dont give the correct days followed up which I need for conducting a survival analysis.&lt;/P&gt;&lt;P&gt;will be glad to be assisted.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Jul 2017 14:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/How-can-I-create-a-variable-for-number-of-days-spend-in-the/m-p/376571#M2588</guid>
      <dc:creator>MUKASADAVID</dc:creator>
      <dc:date>2017-07-17T14:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a variable for number of days spend in the study using the dates of examination</title>
      <link>https://communities.sas.com/t5/All-Things-Community/How-can-I-create-a-variable-for-number-of-days-spend-in-the/m-p/376578#M2589</link>
      <description>&lt;P&gt;Convert your dates into SAS dates. That way you can subtract any two dates to get the number of days elapsed. e.g.:&lt;/P&gt;
&lt;PRE&gt;data want;
  set finished;
  date=input(put(date,8.),yymmdd8.);
  format date date9.;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 14:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/How-can-I-create-a-variable-for-number-of-days-spend-in-the/m-p/376578#M2589</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-17T14:46:28Z</dc:date>
    </item>
  </channel>
</rss>

