BookmarkSubscribeRSS Feed
gordononline
Calcite | Level 5

Hi

 

I have a large SAS EG project that creates, reads and joins 12 tables from a variety of sources.  Occasionally one of the tables that is joined in the final SQL stage has zero rows, but normally all tables have at least one row.  When SAS SQL sees the table with zero rows it throws an error stating that tables must have more than zero rows - but I am unable to control for that with the basic input tables.

 

I'm thinking to insert a dummy row into the problematic table if there are zero rows, to allow for the project to run through to completion.  This would enable the join to occur without actually generating any additional rows of data.  

 

I have two questions that I would appreciate assistance with:

1. is there a better way to prevent this error?

2. how should i place a dummy row into a table (whether or not it has existing data)?

 

Thanks for any suggestions.

 

Doug

1 REPLY 1
SASKiwi
PROC Star

Can you post the log of the offending step including source code, notes, warnings and errors please. As a general rule SAS should cope with zero rows without errors.

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
  • 1 reply
  • 422 views
  • 3 likes
  • 2 in conversation