Hi All,
I have a question on merging when data have duplicate records on the same date. I have thousands of records. Find the sample data below
Data one;
Pid desc trig_date
100 xxxx 19JAN2009
100 yyyy 19jan2009
100 zzzz 17MAY2010
100 bbbb 18OCT2010
100 loss 19OCT2010
Data two;
Pid smpdt
100 19jan2009
100 17MAY2010
100 18OCT2010
Data want;
Pid desc trig_date smpdt
100 xxxx 19JAN2009 19jan2009
100 yyyy 19jan2009
100 zzzz 17MAY2010 17MAY2010
100 bbbb 18OCT2010 18OCT2010
100 loss 19OCT2010
Thanks
Sam
I'm not sure I understand the question.
I'm not sure I understand the question.
Hi Data _null_
You understand the question right. And you gave the right one. Thanks for your help.
i am using lenthy code using retain statment, because date one have few records on trigdt and data two have few records on sampdt . But i need both record in my final dataset.Now i got it with your help
Thanks
Sam
proc sql; create table want as select one.*, two.smpdt from one full join two on one.trig_date=two.smpdt and one.pid=two.pid ; quit;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.