BookmarkSubscribeRSS Feed
Gil_
Quartz | Level 8
I have a query that matches where stores rec ship based on sch I need to determine stores where ship were misd based on sch
My query looks
Proc SQL;
Create table part3 as
(Select * ,
B.Delivery
From part a left join sch b on a.id=b.id
Where a.day=b.day);
Run;
5 REPLIES 5
Reeza
Super User
Ok, so what's the question here?
Gil_
Quartz | Level 8
How do I determine sch ship that was not done. The query above gives me the stores that rec ship
utrocketeng
Quartz | Level 8

something like this?

 

Proc SQL;
Create table part3 as
(Select * ,
B.Delivery
From part a left join sch b on a.id=b.id and a.day=b.day
Where b.id is null);
Run;

Gil_
Quartz | Level 8
Question sch would not be null for example it has all the days with a sch date. When I match I have matching days part.date 06/19/19 sch.day=06/19/19. I would like to see where this happens. part.date 06/22 /19 sch.day=06/25/19. That means they weren't following the sch I need to see these
anushreebiotech
Obsidian | Level 7

Hi,

 

Try this:

 

Proc SQL;
Create table part3 as

select * from part

where part.id not in
(Select * ,
B.Delivery
From part a join sch b on a.id=b.id
and a.day=b.day);
quit;

 

Regards,

Anushree

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 5 replies
  • 931 views
  • 0 likes
  • 4 in conversation