BookmarkSubscribeRSS Feed
Paulnf
Calcite | Level 5

Hi guys,

 

I have a quick question.

 

I have been trying to extract some fields from a table using SQL passthrough for SAS. The table is a Teradata table, and I have checked the table on Teradata and it contains records. However, when I extract the table in SAS, SAS returns an empty table.

 

Log reads:

NOTE: There were 0 observations read from the data set XXXX.

 

Please does anyone understand why SAS retrieves zero rows, and how I can fix this?

 

Thanks,

 

 

6 REPLIES 6
kiranv_
Rhodochrosite | Level 12

you need to give some more information, your sample code and are you using where clause and other details then someone call help you.

Paulnf
Calcite | Level 5

Its a basic data step. No conditional statements

 

data nn;

set xxx(obs=1);

run;

Reeza
Super User

Your original post:

I have been trying to extract some fields from a table using SQL passthrough for SAS. The table is a Teradata table, and I have checked the table on Teradata and it contains records. However, when I extract the table in SAS, SAS returns an empty table.

Your code doesn't match your original post and what you said you were doing, so is this a different question entirely?
What does your log show for your actual code?

 

Paulnf
Calcite | Level 5

HI Reeza,

 

I described the issue wrongly.

 

The code above is what I ran, and there were no error or warning messages in the log.

 

According to the log, 0 records were read and zero records were written out.

 

Hope this helps,

 

 

Reeza
Super User

Well, given that you're not hitting a library at all, but an empty table, I'm guessing the table references is actually empty then. 

What do you want as output from reading an empty table?

 


@Paulnf wrote:

HI Reeza,

 

I described the issue wrongly.

 

The code above is what I ran, and there were no error or warning messages in the log.

 

According to the log, 0 records were read and zero records were written out.

 

Hope this helps,

 

 


 

ballardw
Super User

@Paulnf wrote:

Hi guys,

 

I have a quick question.

 

I have been trying to extract some fields from a table using SQL passthrough for SAS. The table is a Teradata table, and I have checked the table on Teradata and it contains records. However, when I extract the table in SAS, SAS returns an empty table.

 

Log reads:

NOTE: There were 0 observations read from the data set XXXX.

 

Please does anyone understand why SAS retrieves zero rows, and how I can fix this?

 

Thanks,

 

 


If you show the code you used may get a better targeted response.

 

Likely causes if you include any WHERE clauses that no records met the conditions specified; if there were any joins then no records met the join criteria specified.

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
  • 6 replies
  • 1232 views
  • 0 likes
  • 4 in conversation