Hello
I merge multiple data sets .
At least one of the data sets has zero rows.
Why will I get error message during this merge?
Thanks
Have you run the code?
Please post your full log using the </> icon.
I have no SAS at home but it happened at my work.
This is theoretical question.
In normal merge with empty data sets should I receive an error?
The direct answer is NO - as you can see in the attached log:
73 proc sort data=sashelp.class out=class; by name; run; NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: The data set WORK.CLASS has 19 observations and 5 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.02 seconds cpu time 0.03 seconds 74 data class_0; set class; delete; run; NOTE: There were 19 observations read from the data set WORK.CLASS. NOTE: The data set WORK.CLASS_0 has 0 observations and 5 variables. NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.01 seconds 75 76 data check; 77 merge class class_0; 78 by name; 79 run; NOTE: There were 19 observations read from the data set WORK.CLASS. NOTE: There were 0 observations read from the data set WORK.CLASS_0. NOTE: The data set WORK.CHECK has 19 observations and 5 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.02 seconds
@Ronein wrote:
Hello
I merge multiple data sets .
At least one of the data sets has zero rows.
Why will I get error message during this merge?
Thanks
For the same reasons you would with any other merge such common named variables of different types in the different data sets or the data set does not exist (which is different than zero rows).
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.