<?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: vis and date mismatch in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372648#M276114</link>
    <description>&lt;P&gt;Yes, with full join it will do the extra task. However, you'll likely want to include the extra variables so that you can identify what was missing. e.g.:&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
  create table want as
    select a.*, b.id as b_id, b.visitnum as b_visitnum, b.start_date as b_start_date,
       a.visitnum ne b.visitnum as vflag,
       a.start_date ne b.start_date as sflag
          from have1 a full join have2 b
            on a.id eq b.id and
      (a.visitnum eq b.visitnum or a.start_date eq b.start_date)
  ;
quit;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jul 2017 04:46:30 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-07-03T04:46:30Z</dc:date>
    <item>
      <title>vis and date mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372640#M276110</link>
      <description>&lt;P&gt;data have1;&lt;BR /&gt;input ID $ visitnum start_date :mmddyy10. ;&lt;BR /&gt;datalines;&lt;BR /&gt;101 1 8/26/2015&lt;BR /&gt;101 2 9/17/2015&lt;BR /&gt;101 3 10/2/2015&lt;BR /&gt;101 4 10/30/2015&lt;BR /&gt;101 5 11/24/2015&lt;BR /&gt;102 1 3/17/2016&lt;BR /&gt;102 2 3/24/2016&lt;BR /&gt;102 3 3/31/2016&lt;BR /&gt;102 4 4/28/2016&lt;BR /&gt;102 5 5/25/2016&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;data have2;&lt;BR /&gt;input ID $ visitnum start_date :mmddyy10. ;&lt;BR /&gt;datalines;&lt;BR /&gt;101 1 8/26/2015&lt;BR /&gt;101 2 9/17/2015&lt;BR /&gt;101 22 10/2/2015&lt;BR /&gt;101 4 10/30/2015&lt;BR /&gt;101 5 11/24/2015&lt;BR /&gt;102 1 3/17/2016&lt;BR /&gt;102 2 3/24/2016&lt;BR /&gt;102 3 3/30/2016&lt;BR /&gt;102 4 4/28/2016&lt;BR /&gt;102 5 5/25/2016&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;i need to flag subject 101 which has visit 22 mismatch since the dates are same, tehnically visitnum should be 2 for that date.&lt;/P&gt;&lt;P&gt;similary for 102 subject visitnum 3 has 3/30/2016 and have1 dataset has different date , so need to flag that record also. Any suggestions?&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;P&gt;eric&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 03:19:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372640#M276110</guid>
      <dc:creator>eric2</dc:creator>
      <dc:date>2017-07-03T03:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: vis and date mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372642#M276111</link>
      <description>&lt;P&gt;I would use a sql join and create two flags, one to indicate a casenum mismatch, and another to indicate a start_date mismatch. e.g.:&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
  create table want as
    select a.*, b.visitnum as vnum2, b.start_date as sdate2,
       a.visitnum ne b.visitnum as vflag,
       a.start_date ne b.start_date as sflag
          from have1 a join have2 b
            on a.id eq b.id and
      (a.visitnum eq b.visitnum or a.start_date eq b.start_date)
  ;
quit;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 03:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372642#M276111</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-03T03:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: vis and date mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372644#M276112</link>
      <description>&lt;P&gt;Thanks Art.&lt;/P&gt;&lt;P&gt;does this join also work if we have a visit missing in head2 dataset but not in head1 dataset, like &amp;nbsp;head2 has missing visitnum 6 for 102 subject&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have1;&lt;BR /&gt;input ID $ visitnum start_date :mmddyy10. ;&lt;BR /&gt;datalines;&lt;BR /&gt;101 1 8/26/2015&lt;BR /&gt;101 2 9/17/2015&lt;BR /&gt;101 3 10/2/2015&lt;BR /&gt;101 4 10/30/2015&lt;BR /&gt;101 5 11/24/2015&lt;BR /&gt;102 1 3/17/2016&lt;BR /&gt;102 2 3/24/2016&lt;BR /&gt;102 3 3/31/2016&lt;BR /&gt;102 4 4/28/2016&lt;BR /&gt;102 5 5/25/2016&lt;BR /&gt;102 6 6/20/2016&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;data have2;&lt;BR /&gt;input ID $ visitnum start_date :mmddyy10. ;&lt;BR /&gt;datalines;&lt;BR /&gt;101 1 8/26/2015&lt;BR /&gt;101 2 9/17/2015&lt;BR /&gt;101 22 10/2/2015&lt;BR /&gt;101 4 10/30/2015&lt;BR /&gt;101 5 11/24/2015&lt;BR /&gt;102 1 3/17/2016&lt;BR /&gt;102 2 3/24/2016&lt;BR /&gt;102 3 3/30/2016&lt;BR /&gt;102 4 4/28/2016&lt;BR /&gt;102 5 5/25/2016&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 04:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372644#M276112</guid>
      <dc:creator>eric2</dc:creator>
      <dc:date>2017-07-03T04:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: vis and date mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372647#M276113</link>
      <description>&lt;P&gt;ignore my prev post. i used full join and seems it worked. Thanks for your help&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 04:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372647#M276113</guid>
      <dc:creator>eric2</dc:creator>
      <dc:date>2017-07-03T04:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: vis and date mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372648#M276114</link>
      <description>&lt;P&gt;Yes, with full join it will do the extra task. However, you'll likely want to include the extra variables so that you can identify what was missing. e.g.:&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
  create table want as
    select a.*, b.id as b_id, b.visitnum as b_visitnum, b.start_date as b_start_date,
       a.visitnum ne b.visitnum as vflag,
       a.start_date ne b.start_date as sflag
          from have1 a full join have2 b
            on a.id eq b.id and
      (a.visitnum eq b.visitnum or a.start_date eq b.start_date)
  ;
quit;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 04:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372648#M276114</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-07-03T04:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: vis and date mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372813#M276115</link>
      <description>&lt;P&gt;Thanks Art.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 19:14:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vis-and-date-mismatch/m-p/372813#M276115</guid>
      <dc:creator>eric2</dc:creator>
      <dc:date>2017-07-03T19:14:52Z</dc:date>
    </item>
  </channel>
</rss>

