<?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 to identify subjects 1 year from their visit in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722157#M27873</link>
    <description>&lt;P&gt;Please explain the logic that allows you to derive the result from the input data.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 14:55:31 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-02-26T14:55:31Z</dc:date>
    <item>
      <title>How to identify subjects 1 year from their visit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722155#M27872</link>
      <description>&lt;P&gt;I need to identify subjects that have been one year since their last visit? How can I do that?&lt;/P&gt;
&lt;TABLE width="133"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="69"&gt;Last visit&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1/4/2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;5/23/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;4/8/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;9/12/2018&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;8/17/2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;12/5/2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;5/4/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;this is the result I want&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="133"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="69"&gt;Last visit&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;5/23/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;4/8/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;5/4/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 26 Feb 2021 14:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722155#M27872</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-02-26T14:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify subjects 1 year from their visit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722157#M27873</link>
      <description>&lt;P&gt;Please explain the logic that allows you to derive the result from the input data.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 14:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722157#M27873</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-02-26T14:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify subjects 1 year from their visit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722158#M27874</link>
      <description>I want to find subject that has been 1 year from today since their last visit.&lt;BR /&gt;todays data - last visit = the difference in days</description>
      <pubDate>Fri, 26 Feb 2021 14:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722158#M27874</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-02-26T14:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify subjects 1 year from their visit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722159#M27875</link>
      <description>todays date - last visit date= the difference in days</description>
      <pubDate>Fri, 26 Feb 2021 15:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722159#M27875</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-02-26T15:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify subjects 1 year from their visit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722161#M27877</link>
      <description>&lt;P&gt;How do you identify "subject"? Your example "id" does not seem to be the same "subject".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have one or more variables that uniquely identify a subject this is very easy but if you cannot show us how to identify a subject then it gets pretty obnoxious.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, what is the current format for your "last visit" variable? Run proc contents and show us. The dates you show will not appear that way with any of the default SAS date formats so I question whether you are providing data as you have it in a SAS data set.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 15:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722161#M27877</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-26T15:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify subjects 1 year from their visit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722163#M27878</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I need to identify subjects that have been one year since their last visit? How can I do that?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/222563"&gt;@hjjijkkl&lt;/a&gt;&amp;nbsp;Do you mean "identify subjects that have been&lt;FONT color="#FF0000"&gt; less than&lt;/FONT&gt; one year since their last visit"? That's what your output seems to indicate, but your words don't indicate that. You really need to make your words match your example in order to get the quickest answer and the&amp;nbsp; best answer. We're really guessing when your words don't match the desired results, and that's not a good way to get answers by making us guess.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this work for you:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    if intck('year',last_visit,today(),'c')&amp;gt;=1 then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Feb 2021 15:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722163#M27878</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-02-26T15:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify subjects 1 year from their visit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722165#M27879</link>
      <description>the ID represents-  one person.  the iD is from 1-3000, meaning there are 3000 individual in the data.  the date format is in yymmdd10.i have more than one variables</description>
      <pubDate>Fri, 26 Feb 2021 15:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722165#M27879</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-02-26T15:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify subjects 1 year from their visit</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722176#M27880</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

create table visit1year as

select *

from have

where last_visit - today() &amp;gt;= 365;

quit;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How do you define a year? What about leap years?&lt;/P&gt;
&lt;P&gt;If you're using 365 days the formula above will work. If you need a slightly different data calculation you need to explain what that would be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/222563"&gt;@hjjijkkl&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I need to identify subjects that have been one year since their last visit? How can I do that?&lt;/P&gt;
&lt;TABLE width="133"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="69"&gt;Last visit&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1/4/2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;5/23/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;4/8/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;9/12/2018&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;8/17/2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;12/5/2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;5/4/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;this is the result I want&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="133"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="69"&gt;Last visit&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;5/23/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;4/8/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;5/4/2020&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 15:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-identify-subjects-1-year-from-their-visit/m-p/722176#M27880</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-02-26T15:25:35Z</dc:date>
    </item>
  </channel>
</rss>

