BookmarkSubscribeRSS Feed
BETO
Fluorite | Level 6

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

1 REPLY 1
DBailey
Lapis Lazuli | Level 10

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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 839 views
  • 0 likes
  • 2 in conversation