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.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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