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-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 763 views
  • 2 likes
  • 3 in conversation