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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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