Chapter Contents

Previous

Next
LENGTH

LENGTH



Returns the length of an argument

Category: Character


Syntax
Arguments
Details
Examples

Syntax

LENGTH(argument)

Arguments

argument
specifies any SAS expression.


Details

The LENGTH function returns an integer that represents the position of the right-most nonblank character in the argument. If the value of the argument is missing, LENGTH returns a value of 1. If the argument is a numeric variable (either initialized or uninitialized), LENGTH returns a value of 12 and prints a note in the SAS log that the numeric values have been converted to character values.


Examples

SAS Statements Results
len=length('ABCDEF');
put len;
 
6


Chapter Contents

Previous

Next

Top of Page

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