I'm extracting fields from different databases (DB2, Teradata..)/tables as shown in the image below and now I'm not certain to join all those variables to create a one single SAS dataset. Appreciate if someone of you guide me here.
E.g. Assume I'm extracting field A from table X, field B from table Y and field C from table Z and now I want to create a table XYZ which should have the variables A, B and C
You've got the following questions to answer first:
1. What's the logic?
- relationships between the tables
- Join logic
2. Performance
- How can you reduce volumes most efficiently on the data base side before pulling the data into SAS for further processing (joining the tables).
Only when you're really clear about what needs to be done start with implementation using DIS.
proc sql;
create table xyz as select x.a, y.b, z.c from
x left join y on ..... left join z on ..... ;
quit;
Since you didn't specify the joining criteria, I have left those as ......
You've got the following questions to answer first:
1. What's the logic?
- relationships between the tables
- Join logic
2. Performance
- How can you reduce volumes most efficiently on the data base side before pulling the data into SAS for further processing (joining the tables).
Only when you're really clear about what needs to be done start with implementation using DIS.
@Babloo wrote:
If there is a relationship between the tables, can I also lookup
transformation instead of Join transformation?
These are questions you have to answer, by learning about the databases involved.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.