BookmarkSubscribeRSS Feed
KGP
Calcite | Level 5 KGP
Calcite | Level 5

Hello, I have just opened a program code for a data set with 18 variables and 857 rows of data. After I run it, the 18 variables are pulled into Output Data but none of the observations. I have no errors in my log, but I do have the following notes:

 

NOTE: There were 0 observations read from the data set CLN.CLINIC_D_DATA_2020Q2.
NOTE: The data set CLN.CLINIC_D_DATA_2020Q2 has 0 observations and 18 variables.

 

Does anyone know what I am doing wrong? Thank you!

2 REPLIES 2
ballardw
Super User

@KGP wrote:

Hello, I have just opened a program code for a data set with 18 variables and 857 rows of data. After I run it, the 18 variables are pulled into Output Data but none of the observations. I have no errors in my log, but I do have the following notes:

 

NOTE: There were 0 observations read from the data set CLN.CLINIC_D_DATA_2020Q2.
NOTE: The data set CLN.CLINIC_D_DATA_2020Q2 has 0 observations and 18 variables.

 

Does anyone know what I am doing wrong? Thank you!


It is a very good idea to show an entire Proc or data step code along with the notes, warnings or errors. Best is to copy from the log and paste into a code box opened on the forum with the {I} or "running man" icons to preserve text formatting as the message windows will reformat text.

 

And congratulations, you have discovered exactly why it a poor idea to use code that looks like:

data CLN.CLINIC_D_DATA_2020Q2;
    set CLN.CLINIC_D_DATA_2020Q2;
<any other code>;
run;

This code will completely rewrite the original data set. So a logic issue can do such things as remove any or all records. Which seems likely.

You will need to go back to what ever previously created your data set and redo it.

 

As a minimum it is a good idea to test new code sending the data to a work library version of your data set to verify that things work as expected before using the above construct. Be very sure that all of your values are as expected though.

Patrick
Opal | Level 21

Please share your code and log.

 

Did you by any chance issue options obs=0 in your session?

options obs=0;
data test;
  set sashelp.class;
run;
NOTE: There were 0 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.TEST has 0 observations and 5 variables.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 2 replies
  • 2203 views
  • 0 likes
  • 3 in conversation