BookmarkSubscribeRSS Feed
rakeshvvv
Quartz | Level 8

I have dataset abc with 4 variables ID,VISITNAME,VISITNUM,VISITDATE with ID being the primary key....this dataset and will have information only relating to all possible

visits for that id.This dataset is dynamic and dataset will keep updating as and when new visits take place which is expected to continue for over a period of time(2 years)....visitnum could be 1,2,3,4,5,6,to n......

There are other datasets like x,y,z which will have other information and also VISITNAME,VISITNUM,VISITDATE as supporting variables to complement the data...

i would like write a query in such a way that VISITNUM,VISITDATE in abc dataset should match the corresponding VISITNUM,VISITDATE in other datasets x,y,z....if they are not matching then it is a discrepancy and we should

output those discrepancies for those individual datasets....

thanks

Rakesh

1 REPLY 1
ballardw
Super User

If you are looking for vistnum the same with a different date something like:

proc sql;

     select a.*, b.visitdate as differentvisitdate

     from abc as a left joint x as b

          on a.visitname=b.visitname and a.visitnum= b.visitnum

     where a.visitdate ne b.visitdate;

quit;

might be start. I include the ID and name so you know where to look.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 615 views
  • 3 likes
  • 2 in conversation