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,
you need to give some more information, your sample code and are you using where clause and other details then someone call help you.
Its a basic data step. No conditional statements
data nn;
set xxx(obs=1);
run;
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?
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,
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,
@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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.