Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

NUM Function

produces a numeric representation of a character matrix

NUM( matrix)

where matrix is a character matrix or a quoted literal.

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.

An example using the NUM function is shown below:

   c={'1' '2' '3'};
   j=num(c);

           C        1 row       3 cols    (character, size 1)

                               1 2 3


           J        1 row       3 cols    (numeric)
                       1         2         3
See also the description of the CHAR function, which does the reverse conversion.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.