04-29-2014 04:31 AM
I have three data sets ONE, TWO and THREE.
They have the same variables: ID, VAR1, VAR2, VAR3 and VAR4.
Each ID can have multiple records. Each ID can be member of more than one of the data sets: 1, 2 or all three. If so, the ID:s records are the same in all the data sets where the ID occurs.
I want to have each ID:s all records in one data set: RESULT.
If I first sort ONE, TWO and THREE by ID, will the following code produce what I want, or can it be done even simpler?
SET ONE TWO THREE;
04-29-2014 04:42 AM
Your solution will give you work.result sorted by id and (implicitly) by occurence in one, two, three.
04-29-2014 07:53 AM
The question is, should dataset result have x records where x is the sum of all records of one,two,three, regardless of the contents, or should records be eliminated if two identical records are found in different datasets?
04-29-2014 08:57 AM
I give an example:
ID = 1 have a total of 2 reccords in data set ONE.
ID = 1 does not occur in data set TWO..
ID = 1 occurs also in data set THREE with the same 2 records as in data set ONE.
In data set RESULT, ID = 1 should have the same 2 records as in data set ONE and THREE, and NOT those 2 records twice.
04-29-2014 09:00 AM
Is it possible to have completely identical records in one of the datasets?