06-26-2013 07:51 AM
Is this just for one column in a data set, if yes then a simple solution would be to use a data step including the following line of code:
if my_var=0 then my_var=.;
I did notice that you surrounded the zero value with quotes ("0"), so if it is a character variable then you could use:
if my_var="0" then my_var="";
06-26-2013 07:55 AM
For a function you could conditionally use in a data step:
and it wouldn't matter if the variable is numeric or character.
Message was edited by: Amir Malik - added data step reference.
06-26-2013 08:25 AM
drop i j;
array c(*) _char_; /*or all your char variables that need to be converted*/
array n(*) _numeric_; /*or all your numeric variables that need to be converted*/
do i = 1 to hbound(c); /*sets the defined char vars where 0 to blank*/
if c(i) = "0" then c(i) = "";
do j = 1 to hbound(n); /*sets the defined numeric variables where 0 to missing*/
if n(j)=0 then n(j)=.;
Hope this helps!