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

Hello,

 

I have a character date column (yymmdd10.) in the sas dataset. It has missing values. I have to replace all missing values with empty value ' '.

Trying to make it through proc sql with update statement but nothing happens, column still has missing values

proc sql;

update work.char_atg

set

birthday = ''

where missing(birthday)

;

quit;

run;

Any help would appreciate!

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

This request does not make much sense. 

 

If the variable is character then "missing" values are already blanks.  SAS uses fixed length character variables and pads all values with spaces to defined length.

 

If the variable is numeric (that is an actual number of days since 1/1/1960) then you can cannot store a character string like a space into the variable.   You can change the MISSING option to change how the numeric missing values print. 

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

This request does not make much sense. 

 

If the variable is character then "missing" values are already blanks.  SAS uses fixed length character variables and pads all values with spaces to defined length.

 

If the variable is numeric (that is an actual number of days since 1/1/1960) then you can cannot store a character string like a space into the variable.   You can change the MISSING option to change how the numeric missing values print. 

Alex91
Fluorite | Level 6
Ty Tom. Solved the issue using missing option.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 4117 views
  • 1 like
  • 2 in conversation