Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Working with Matrices

Scalars

Scalars are matrices that have only one element. You define a scalar with the matrix name on the left-hand side of an assignment statement and its value on the right-hand side. You can use the following statements to create and display several examples of scalar literals. First, you must invoke the IML procedure.

   >  proc iml;

      IML Ready

   >  x=12;
   >  y=12.34;
   >  z=.;
   >  a='Hello';
   >  b="Hi there";
   >  print x y z a b;

                  X          Y          Z  A      B
                 12      12.34          .  Hello  Hi there
Notice that, when defining a character literal, you need to use either single quotes (') or double quotes ("). Using quotes preserves uppercase and lowercase distinctions and embedded blanks. It is also always correct to enclose the data values inside of braces ({ }).

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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