Desktop productivity for business analysts and programmers

How to do one to one merging in SAS Enterprise Guide

Accepted Solution Solved
Reply
SAS Employee
Posts: 2
Accepted Solution

How to do one to one merging in SAS Enterprise Guide

Hello,

 

I have two data sets with three rows each and i want want to do one to one merge in Enterprise Guide using the GUI. How can i do that? In query builder such an option does nto exist. I do not want to use any code.

 

 

Thanks,

 

 

Andreas 


Accepted Solutions
Solution
‎08-10-2016 08:28 AM
Trusted Advisor
Posts: 1,052

Re: How to do one to one merging in SAS Enterprise Guide

There really isn't any formal way, because SAS implements queries with SQL, which is dependent on keys for matching.

 

However, there is a rather iffy option. For each of your input tables, do a query, and create a new computed column / advance expression. In the expression, use

monotonic()

and name the column SeqNum or some such thing. This should put a sequential number into each row of the table. You can then do an inner join.

 

Note that the monotonic function isn't supported, to the best fo my knowledge. If you search the communities, you'll find a lot of discussion of it.

 

Tom

View solution in original post


All Replies
Solution
‎08-10-2016 08:28 AM
Trusted Advisor
Posts: 1,052

Re: How to do one to one merging in SAS Enterprise Guide

There really isn't any formal way, because SAS implements queries with SQL, which is dependent on keys for matching.

 

However, there is a rather iffy option. For each of your input tables, do a query, and create a new computed column / advance expression. In the expression, use

monotonic()

and name the column SeqNum or some such thing. This should put a sequential number into each row of the table. You can then do an inner join.

 

Note that the monotonic function isn't supported, to the best fo my knowledge. If you search the communities, you'll find a lot of discussion of it.

 

Tom

SAS Employee
Posts: 2

Re: How to do one to one merging in SAS Enterprise Guide

Thanks a lot,

That worked!

Andreas
Grand Advisor
Posts: 17,332

Re: How to do one to one merging in SAS Enterprise Guide

Do you not have a field to join on? Otherwise in query builder add a new table and then the join condition becomes available. 

 

The add a table and join options are above the column where the variables are listed. 

 

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 257 views
  • 2 likes
  • 3 in conversation