BookmarkSubscribeRSS Feed
anare
Calcite | Level 5

Hi Team,

 

I have two data sets, when i tried to joining two tables all the records are getting copied from right table except few date columns missing. after certain records its pasting.

 

Example below:- 

 

Table :- 

NumberClosedSales rep
967717/22/2020 0:00Madhu
96768 Radha
967717/21/2020 17:59Shankar
909627/20/2020 17:59Madhu
95527 Radha
93647 Shankar
963627/22/2020 17:59Madhu
963617/20/2020 17:59Radha
96339 Shankar

 


Table B

NumberClosedSuppliesVendor
967717/22/2020 17:59InkAbc
967687/22/2020 17:59PenBCD
967657/22/2020 17:59PrinterAbc
967627/22/2020 17:59InkBCD
967597/22/2020 17:59PenBD
967567/22/2020 17:59PrinterCD
967537/22/2020 17:59InkAbc
967507/22/2020 17:59PenAbc
967477/22/2020 17:59PrinterBcd

 

I need output like latest record based on closed column from table b as join to table A. 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Show us the output you want.

--
Paige Miller
smantha
Lapis Lazuli | Level 10
proc sql;
create table want as 
select b.*,a.Sales_rep
from
b b
left join 
a a
on a.id= b.id;
quit; 

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
  • 2 replies
  • 786 views
  • 0 likes
  • 3 in conversation