Help using Base SAS procedures

running date

Reply
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

select

     t1.Receipt_Day,

     t1.id,

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

from

     first_table t1

     inner join second_table t2

        on t1.id=t2.id;

quit;

Ask a Question
Discussion stats
  • 1 reply
  • 201 views
  • 0 likes
  • 2 in conversation