BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

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

 

 

4 REPLIES 4
Shmuel
Garnet | Level 18

Have you run the code?

Please post your full log using the </> icon.

Ronein
Meteorite | Level 14

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?

 

 

Shmuel
Garnet | Level 18

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
ballardw
Super User

@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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 772 views
  • 0 likes
  • 3 in conversation