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; 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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