## Join two datasets

Solved
Frequent Contributor
Posts: 114

# Join two datasets

I have 2 data sets I need to combine here is 1st one
Number date id total
123. 12/01/17. 1. 30
345. 05/07/17. 10. 60
453. 06/17/17. 20. 90
323. 06/23/17. 50. 50
2nd table .
Number. 2 Date.2 id total 2
123. 03/07/18. 1. 50
345. 03/07/18. 10 100
453 03/07/18. 20 60
323. 07/07/18. 50 80
I want to see
Number. Date. Id. Order. Order2
123. 12/01/17. 1. 30. 50
345. 05/07/17. 5 60. 100
453. 06/17/17. 10 90. 60
323. 06/23/17. 50. 50. 80
When I do a join the number to number the id number is out of sequence where 1 is match up to 20.

Accepted Solutions
Solution
‎03-13-2018 04:59 PM
Super User
Posts: 13,542

## Re: Join two datasets

Gil_ wrote:

When I do a join the number to number the id number is out of sequence where 1 is match up to 20.

Show the code you used. And "where 1 is match up to 20" doesn't make much sense in terms of what you have shown.

Provide example data in the form of data steps if you want tested code. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

All Replies
Solution
‎03-13-2018 04:59 PM
Super User
Posts: 13,542

## Re: Join two datasets

Gil_ wrote:

When I do a join the number to number the id number is out of sequence where 1 is match up to 20.

Show the code you used. And "where 1 is match up to 20" doesn't make much sense in terms of what you have shown.

Provide example data in the form of data steps if you want tested code. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

☑ This topic is solved.