BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Babloo
Rhodochrosite | Level 12

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

 

SAS JOB_3.JPG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

@Babloo

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.

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26
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 ......

--
Paige Miller
Babloo
Rhodochrosite | Level 12
What if I don't have common variables between those tables?
Patrick
Opal | Level 21

@Babloo

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
Rhodochrosite | Level 12
If there is a relationship between the tables, can I also lookup
transformation instead of Join transformation?
PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 5 replies
  • 3025 views
  • 3 likes
  • 3 in conversation