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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 467 views
  • 3 likes
  • 2 in conversation