BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi Folks,
I have a dataset with 30 different variables with each cell being either a ONE or a . ( missing numeric value, Now I would like to change the . ( numeric blank) to ZERO. I don't want to use proc format. I just need a physical ZERO in place of that . (BLANK). I can use a if..then 30 times to do that .. but can someone suggest a better way.

Thanks

Matt
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Use a DATA step with an ARRAY, as coded below:

ARRAY ANUMVARS (*) _NUMERIC_;
DO I=1 TO DIM(ANUMVARS);
IF ANUMVARS(I) = . THEN ANUMVARS(I) = 0;
END;


Scott Barry
SBBWorks, Inc.
data_null__
Jade | Level 19
With SAS/Stat procedure STDIZE you can easily replace all those missing values with any value you like including zero.
Peter_C
Rhodochrosite | Level 12
If you only want to see missings as physical zero in reporting, then change no data! All you need - only before the reporting procedure, just set [pre] option missing= '0' ;[/pre]

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 877 views
  • 0 likes
  • 4 in conversation