NUM(
matrix )
;
The NUM function produces a numeric representation of elements in a character matrix. The NUM function takes as an argument a character matrix with elements that are character numerics and produces a numeric matrix with dimensions that are the same as the dimensions of the argument and with elements that are the numeric representations (double-precision floating-point) of the corresponding elements of the argument.
For example, following statements display the result of converting a character matrix to a numerical matrix:
c = {"1" "2" "3"};
reset print; /* display values and type of matrices */
m = num(c);
Figure 23.197
Numeric Matrix
You can also use the PUTN function in Base SAS software to apply a SAS format to each element of a numeric matrix. The resulting matrix is character.
See also the description of the CHAR function which converts numeric matrices into character matrices.
Copyright © SAS Institute, Inc. All Rights Reserved.