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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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