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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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