BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Gil_
Quartz | Level 8
I have 2 data sets thst are same one has historical data and the one is daily
Table a
Code. Date. Dollar. Recommend
123. 03/212018. 1. 500
123. 03/21/2018. 2. 300
123. 03/21/2018. 100. 200

Table b
Dnd. date.max Dollar. Max Amt max
123. 01/01/2018. 1. 600
123. 12/01/2017. 2. 500


What I need the tables to merge Ive data step set thst merges but the dollar amt doesn't match max dollar
It only matches dnd to dnd.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@Gil_ wrote:


What I need the tables to merge Ive data step set thst merges but the dollar amt doesn't match max dollar
It only matches dnd to dnd.


Show the code you attempted and the actual desired result for your example data.

 

I suspect that your dates play some role in the attempted merge but you will have to state what that would be.

View solution in original post

6 REPLIES 6
Reeza
Super User

What are you expecting as output?

ballardw
Super User

@Gil_ wrote:


What I need the tables to merge Ive data step set thst merges but the dollar amt doesn't match max dollar
It only matches dnd to dnd.


Show the code you attempted and the actual desired result for your example data.

 

I suspect that your dates play some role in the attempted merge but you will have to state what that would be.

Gil_
Quartz | Level 8
Here how I want data merge
Code. Date. Dollar. Reco dnd mdate. Dol amt
123. 03/212018. 1. 500. 123 01/01/2018. 1. 600
123. 03/21/2018. 2. 300 123 12/01/2018 2. 500
123. 03/21/2018. 100. 200
LinusH
Tourmaline | Level 20
And the code tried...?
Data never sleeps
Gil_
Quartz | Level 8
I tried
Data tablec;
Merge tablea tableb;
By dnd;
Run;
Gil_
Quartz | Level 8
Did sort by dnd b4

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!

What is Bayesian Analysis?

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.

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