in "filename email" online help, you'll find an example,
The easy way to count columns missing in one observation (old forum discussion) http://support.sas.com/forums/thread.jspa?messageID=31443#31443
or similarly[pre] cols_missing = nmiss( of _numeric_,1 ) + cmiss( of _character_, 'a' ) ;[/pre] but that cmiss() is a new function in SAS9.2
Do you need a SAS91 alternative?
just been trying out that suggestion I made and find I would like to update it
cols_missing = nmiss( of _numeric_,1 ) + cmiss( of _character_, 'a' ) ;
returns 1 if the only missing value is in the cols_missing result !
So now I'm suggesting[pre] cols_missing = 0 ; * ensure this is not missing ;
cols_missing = nmiss( of _numeric_,1 ) + cmiss( of _character_, 'a' ) ;[pre]
Why is it safer if you are still using _character_ and _numeric_ to define the arrays? Would the array definition create syntax error when there are no character variables?
I tested my code and that is why the initialisation of col
_missing to zero was proposed.
Yes I realize now that you have corrected the bug with the initialization of COL_MISSING.
The safer part I was referring to has to do with where the program uses _NUMERIC_, just after SET before anything else, like defining other numeric variables happen. I often use [pre]IF 0 THEN SET;[/pre] if my program to isolate the variables when creating the ARRAYS.
It is a common mistake to see _NUMERIC_ used on the left side of an expression as you did, we don't usually remember that the variable on the left COL_MISSING is also included in the list described by _NUMERIC_.
For me creating the array just after the set as in my example frees me of the having to remember that the variables in _NUMERIC_ may change as I write new statements.