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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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