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

Is there any way to convert a variable containing zero observations to numeric?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

A variable that has zero observations? Delete the variable, then create a new variable that is numeric of the same name.

 

data want;
     set have(drop=variable);
     length variable 8;
run;
--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

A variable that has zero observations? Delete the variable, then create a new variable that is numeric of the same name.

 

data want;
     set have(drop=variable);
     length variable 8;
run;
--
Paige Miller
TANMOY05
Obsidian | Level 7
Thank u!!
Kurt_Bremser
Super User
A little foray into SAS diction:
Libraries contain datasets (aka tables)
Datasets contain observations (aka records)
Observations contain variables (aka columns)
Variables contain values

A variable can therefore not contain observations.
A table (dataset) might contain zero (no) observations.
A variable might contain only missing values, which is probably what you mean.
In order to not mislead everybody else, using the correct names for things is mandatory.
TANMOY05
Obsidian | Level 7
Ok, noted!!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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