Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Understanding the Language

Character Literals

You input a character matrix literal by entering character strings. If you do not use quotes, all characters are converted to uppercase. You must use either single or double quotes to preserve case or when blanks or special characters are present in the string. For character matrix literals, the length of the elements is determined from the longest element. Shorter strings are padded on the right with blanks. For example, the assignment of the literal

   a={abc defg};
results in A being defined as a 1 ×2 character matrix with string length 4 (the length of the longer string).
                                A
                                ABC  DEFG
The assignment
   a={'abc' 'DEFG'};
preserves the case of the elements, resulting in the matrix
                                A
                                abc  DEFG
Note that the string length is still 4.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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