Please please tell me what is wrong with this code. it is not working.
/*Merging visit and std elements datasets by unique id*/
data JanFeb_COMPLETE_2019;
merge janfebs.CONCATENATE_JAN2FEB_2019(in=A) CONCATENATE_KEENAN_CLN19(in=B);
by UNIQUE_ID;
If a and b;
run;
the log says
3142 data JanFeb_COMPLETE_2019;
3143 merge janfebs.CONCATENATE_JAN2FEB_2019(in=A) CONCATENATE_KEENAN_CLN19(in=B);
3144 by UNIQUE_ID;
3145 If a and b ;
3146 run;
NOTE: There were 702 observations read from the data set JANFEBS.CONCATENATE_JAN2FEB_2019.
NOTE: There were 79 observations read from the data set WORK.CONCATENATE_KEENAN_CLN19.
NOTE: The data set WORK.JANFEB_COMPLETE_2019 has 0 observations and 69 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
I just checked
There are values of UNIQUE_ID that appear in both incoming data sets I just checked.
It works if I say if a or if b but it just does not work when I say if a and b.
Please help me to figure out what is wrong in this code. I am trying to merge data from two data sets if the records are in both data sets.
data JanFeb_COMPLETE_2019;
merge CONCATENATE_KEENAN_CLN19 (in=B) janfebs.CONCATENATE_JAN2FEB_2019(in=A);
by UNIQUE_ID;
If a and b;
run;
Maxim 3: Know Your Data.
You do not have any matches.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.