BookmarkSubscribeRSS Feed
gtucke1
Fluorite | Level 6

The variable ci_2n has a value that was entered as -8. This should be changed to be missing. Below is the code I've tried:

Data unmet.original5;
Set unmet.original4;
If ci_2n = -8 then ci_2n_fix = '.';
Run;

Proc freq data = unmet.original5;
Table ci_2n_fix;
Run;

 

The table now shows all 637 observations as missing.

I don't know how to make the -8 vale as missing without making all of the observations as

 

 

 
 

 

 
 

 

 
 
 

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26
Data unmet.original5;
Set unmet.original4;
If ci_2n = -8 then ci_2n_fix = .;
else ci_2n_fix = ci_2n;
Run;

 

 

or

 

Data unmet.original5;
Set unmet.original4;
If ci_2n = -8 then ci_2n = .;
Run;

 

--
Paige Miller
Anne_A
Quartz | Level 8

A few questions:

  • Why is your new variable a character one while the original is numeric?
  • What is the frequency of ci_2n being equal to -8 in your original dataset?

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