New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
KevinL
Fluorite | Level 6

Good day,

 

I am new to Miner and have the following problem:

 

I have two datasets.  The first dataset has accounts with unique identifiers which then have variables (value etc).  The second dataset has most of the unique identifiers from dataset one plus a few new accounts and some of the variables (eg value) have been updated.

 

What I'm looking to do it to have a merged dataset which contains all of the accounts from both datasets, as well as variables (eg value) for both datasets in separate columns.  It will look as follows:

 

Dataset one                            Dataset two                               New dataset

 

Account     Value                    Account       Value                     Account       Value(1)   Value(2)

Acc1           10                        Acc1            10                          Acc1            10             10

Acc2           30                        Acc2            25                          Acc2            30             25

Acc3           25                        Acc3            40                          Acc3            25             40

                                               Acc4            5                            Acc4                             5

 

Is this possible in Miner and if so can someone please assist?

2 REPLIES 2
Astounding
PROC Star

This would be a standard approach using base SAS (not EM).

 

Assuming both data sets are sorted:

 

data want;

merge dataset_one (rename=(value=value1))

   dataset_two (rename=(value=value_2));

by account;

run;

 

I'm not sure how you rename fields in EM, but there must be a way.

WendyCzika
SAS Employee

You should be able to use the Merge node in EM for this.  Just be sure to set the Merging property to Match, select Account as a By Ordering variable, set Overwrite Variables property to No, and any variables that are named the same in both data sets need to be flagged with No for Overwrite Variable in the Edit Variables window.  

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1620 views
  • 0 likes
  • 3 in conversation