Functions and CALL Routines |
Category: | Character |
Restriction: | I18N Level 2 |
Syntax | |
Arguments | |
Details | |
Length of Returned Variable | |
The Basics | |
Examples |
Syntax |
QUOTE(argument) |
Details |
In a DATA step, if the QUOTE function returns a value to a variable that has not previously been assigned a length, then that variable is given a length of 200 bytes.
The QUOTE function adds double quotation marks, the default character, to a character value. If double quotation marks are found within the argument, they are doubled in the output.
The length of the receiving variable must be long enough to contain the argument (including trailing blanks), leading and trailing quotation marks, and any embedded quotation marks that are doubled. For example, if the argument is ABC followed by three trailing blanks, then the receiving variable must have a length of at least eight to hold "ABC###". (The character # represents a blank space.) If the receiving field is not long enough, the QUOTE function returns a blank string, and writes an invalid argument note to the log.
Examples |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.