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!!