11-16-2014 09:40 PM
I have 2 different datasets. Dataset 1 has about 500 observations and 15 variables and Dataset 2 has 7500 observations and 250 variables.
I have to import that 250 variables from Dataset 2 for that 500 observations in Dataset 1 (note 500 observations in dataset 1 are present in dataset 2 by three common identifiers: last name, first name and IDnumber)
If I use a
merge dataset1 dataset2; by firstname lastname IDnumber;
I am thinking I am going to get 7500 observations with 500 of them having that 15 extra variables (-3 common identifiers) from dataset 1.
Any idea how else I could use to merge this and just have a new combined dataset that has 500 observations from Dataset with 15 + 250 variables ?
Your help is much appreciated !!!
11-16-2014 09:50 PM
Figured it out myself.
Just a simple delete command for a variable thats only present in dataset 1 but not in dataset2 by writing
if variable =' ' then delete;
worked like a charm
Just a little extra thinking that I was lacking when initially thinking about it.
Thanks anyways for folks reading this !
Need further help from the community? Please ask a new question.