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]
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.

SAS Training: Just a Click Away

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

Browse our catalog!

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