BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
hz16g22
Obsidian | Level 7

For some reason it keeps creating a new sheet in the folder with zero observations, I would like to know where I'm going wrong.

 

data female_names;
	set female_names;
	fraction = count/180623104;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

In SAS, there are no "sheets", there are data sets.

 

The code you provided probably means you have somehow over-written the original female_names data set with an empty one, and so you need to re-create the non-empty female_names data set. The code uses a poor practice of overwriting a data set with a new data set of the same name. Better is this:

 

data female_names1;
	set female_names;
	fraction = count/180623104;
run;

 

In this case, a brand new data set female_names1 is created, and female_names is unchanged.

 

From now on, when you get errors in the log, show us the ENTIRE log for the step (PROC or DATA step) that has the errors. When I say ENTIRE log, I mean every single line, whether it contains the error, or not.

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

In SAS, there are no "sheets", there are data sets.

 

The code you provided probably means you have somehow over-written the original female_names data set with an empty one, and so you need to re-create the non-empty female_names data set. The code uses a poor practice of overwriting a data set with a new data set of the same name. Better is this:

 

data female_names1;
	set female_names;
	fraction = count/180623104;
run;

 

In this case, a brand new data set female_names1 is created, and female_names is unchanged.

 

From now on, when you get errors in the log, show us the ENTIRE log for the step (PROC or DATA step) that has the errors. When I say ENTIRE log, I mean every single line, whether it contains the error, or not.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 652 views
  • 1 like
  • 2 in conversation