Help using Base SAS procedures

running date

Regular Contributor
Posts: 240

running date

HI ,

i have a  firzt table that has all the work submitted today . The work could have been process between 1-4 days ago

REcipt day.        Id.              Day Work

10/28/14.           a.                    10/27/14

10/28/14.             B.                    10/26/14

10/28/14.               F.                     10/17/14

i have another 2nd table that houses all data for day work

id.       Day work

A           10/27/14

B.           10/26/14

c.              10/27/14

d.               10/28/14

i would want everything from the second table an only where we match on the first table... Which I do know how to do... The part that I'm having difficulty visualization is how do I make it so that new dates are being added for example 10/29/14,10/30/14, an if the day diff is greater than 4 make it be out compliance

REcipt day.        Id.              Day Work.      Compliance

10/28/14.           a.                    10/27/14.         Compare  to 2nd table it's there an it is yes

10/28/14.             B.                    10/26/14.        Compare  to 2nd table it's there an it is yes

10/28/14.               F.                     10/17/14.      Day diff is greater than 4 it is no

Super Contributor
Posts: 578

Re: running date

looks like you can calculate the compliance attribute based on data in the first table?  But if you also need to ensure the ID is in the second table..

proc sql;

create table want as



     case when intck('day',t1.day_work,t1.receipt_day) > 4 then 'N' else 'Y' end as Compliant_YN


     first_table t1

     inner join second_table t2



Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation