-1

I have one data set looking like this:

ID Name YoB  ApproximateYob

1  Aa   1980 1980

1  Aa   1980 1979

1  Aa   1980 1981

2  Bb   1990 1991

2  Bb   1990 1989

2  Bb   1990 1990

-And another one like this:

ID Name YoB  Title Country Alias

1  Aa   1980 Xx    US

1       1980 Xx    US      Ab

2  Bb   1990 Zz    UK      

2       1990 Zz    UK      Bc

What I would need is this:

ID Name YoB  ApproximateYoB Title Country Alias

1  Aa   1980 1980           Xx     US     

1  Aa   1980 1979           Xx     US   

1  Aa   1980 1981           Xx     US 
1       1980 1980           Xx     US     Ab 

1       1980 1981           Xx     US     Ab 

1       1980 1979           Xx     US     Ab 

2  Bb   1990 1990           Zz     UK

2  Bb   1990 1991           Zz     UK

2  Bb   1990 1989           Zz     UK

2       1990 1990           Zz     UK     Bb 

2       1990 1991           Zz     UK     Bb

2       1990 1989           Zz     UK     Bb

Would anyone be able to help how to get this done in SAS Data Integration Studio? Preferably with the graphical tools. But if not possible then with proc sql or data steps.

Br

J_Lard
  • 1,083
  • 6
  • 18
Matthias
  • 1
  • 1
  • Hi and welcome to stackoverflow. We can help you with specific problems with your code, but we don't write the code for you. Please see [ask]. Do some research, then [edit] your question and add your code as a [mcve]. What is the problem with it? What happens when you run it? What did you expect to happen instead? Any errors? Good luck! – Robert May 14 '19 at 22:18
  • I think you want a CROSS join on the `ID` fields. https://support.sas.com/documentation/cdl/en/etlug/67323/HTML/default/viewer.htm#p15rvjcoy7952ln1txgxuxlrscdn.htm – Nickolay May 14 '19 at 23:42

2 Answers2

1

Since your second dataset has a "redundant" record, i would suggest that you do it in two steps :-

Step 1. A Data step to remove or merge the two records in dataset 2

ID Name YoB Title Country Alias

1 Aa 1980 Xx US Ab

2 Bb 1990 Zz UK Bc

Step 2: A DI Join transformation should give you the output that you need

Hope this helps

0

You'll need Join transformation from SQL tab. Configure it according to your needs and check the result table to make sure it matches you'r expectations.

You can find more info here