BookmarkSubscribeRSS Feed
gordononline
Fluorite | Level 6

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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 521 views
  • 3 likes
  • 2 in conversation