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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 1945 views
  • 0 likes
  • 4 in conversation