<?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: code help in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125457#M10322</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it should be count(visit_time) rather than count(*) actually....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And 1 looks, correct, three visits:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2004-12-12&lt;/P&gt;&lt;P&gt;2005-01-12&lt;/P&gt;&lt;P&gt;2005-04-07&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the full details before the filter/sort.&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table summary as&lt;/P&gt;&lt;P&gt;select one.id, count(visit_time) as num_visits, *, time_threshold-visit_time as diff&lt;/P&gt;&lt;P&gt;from one&lt;/P&gt;&lt;P&gt;left join two&lt;/P&gt;&lt;P&gt;on one.id=two.id;&lt;/P&gt;&lt;P&gt;/*and one.time_threshold-two.visit_time between 1 and 365*/&lt;/P&gt;&lt;P&gt;/*group by one.id;*/&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2012 21:16:08 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2012-11-13T21:16:08Z</dc:date>
    <item>
      <title>code help</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125454#M10319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;Hi all,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;I’d like to ask if you can help on this. I would like to know the numbers of visits one year before the date of ‘time_threshold’in table one, but not including the visit on the date of time_threshold. For example, the first person’s time_threshold is 20050917, then the number of visits 12 months before this date is 2 times (not including the 'time_threshold' visit). Table two includes all records in terms of visit time by each person.&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;The table that I am looking for is as follows:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="padding-bottom: 0px; padding-left: 5.4pt; padding-right: 5.4pt; margin-left: 4.65pt; padding-top: 0px;" width="128"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="padding-left: 5.4pt; padding-right: 5.4pt; border: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;Id&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-bottom: windowtext 1pt solid; border-left: medium none; padding-left: 5.4pt; padding-right: 5.4pt; border-top: windowtext 1pt solid; border-right: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;Counts&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-bottom: windowtext 1pt solid; border-left: medium none; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;2&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-bottom: windowtext 1pt solid; border-left: medium none; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;3&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-bottom: windowtext 1pt solid; border-left: medium none; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;0&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD nowrap="nowrap" style="border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;4&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD nowrap="nowrap" style="border-bottom: windowtext 1pt solid; border-left: medium none; padding-left: 5.4pt; padding-right: 5.4pt; border-top: medium none; border-right: windowtext 1pt solid;" valign="bottom" width="64"&gt;&lt;P align="right" style="text-align: right;"&gt;&lt;SPAN style="color: black;"&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; one;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; id time_threshold &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;yymmdd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; time_threshold &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;yymmdd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;1 20050917&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;2 20071005&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;3 20050606&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;4 20090116&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; two;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; id visit_time &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;yymmdd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; visit_time &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;yymmdd10.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;1 20041212&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;1 20031105&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;1 20050917&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;1 20050407&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;1 20050112&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;2 20071005&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;2 20090301&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;2 20061215&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;2 20110915&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;3 20050606&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;3 20050918&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;4 20101112&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;4 20090116&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;4 20080909&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp; a lot for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 20:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125454#M10319</guid>
      <dc:creator>user1</dc:creator>
      <dc:date>2012-11-13T20:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: code help</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125455#M10320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table summary as&lt;/P&gt;&lt;P&gt;select one.id, count(*) as num_visits&lt;/P&gt;&lt;P&gt;from one&lt;/P&gt;&lt;P&gt;left join two&lt;/P&gt;&lt;P&gt;on one.id=two.id&lt;/P&gt;&lt;P&gt;and one.time_threshold-two.visit_time between 1 and 365&lt;/P&gt;&lt;P&gt;group by one.id;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 21:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125455#M10320</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-11-13T21:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: code help</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125456#M10321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much for your prompt reply! I run the code, but the results for person 1 and 3 did not look correct. For example, person 3 should have 0 visit, but the result showed 1 visit for this person. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 21:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125456#M10321</guid>
      <dc:creator>user1</dc:creator>
      <dc:date>2012-11-13T21:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: code help</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125457#M10322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it should be count(visit_time) rather than count(*) actually....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And 1 looks, correct, three visits:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2004-12-12&lt;/P&gt;&lt;P&gt;2005-01-12&lt;/P&gt;&lt;P&gt;2005-04-07&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the full details before the filter/sort.&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table summary as&lt;/P&gt;&lt;P&gt;select one.id, count(visit_time) as num_visits, *, time_threshold-visit_time as diff&lt;/P&gt;&lt;P&gt;from one&lt;/P&gt;&lt;P&gt;left join two&lt;/P&gt;&lt;P&gt;on one.id=two.id;&lt;/P&gt;&lt;P&gt;/*and one.time_threshold-two.visit_time between 1 and 365*/&lt;/P&gt;&lt;P&gt;/*group by one.id;*/&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 21:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125457#M10322</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-11-13T21:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: code help</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125458#M10323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much! I've got the right table I wanted.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 21:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/code-help/m-p/125458#M10323</guid>
      <dc:creator>user1</dc:creator>
      <dc:date>2012-11-13T21:23:50Z</dc:date>
    </item>
  </channel>
</rss>

