| SAS Component Language Dictionary |
| Category: | Formatting |
| Syntax | |
| Details | |
| Examples | |
| Example 1: Verifying the Validity of a Character Format | |
| Example 2: Verifying the Validity of a Numeric Format | |
| See Also | |
Syntax |
| rc=FORMAT(format,type); |
contains the return code for the operation:
| 1 | |
| 0 |
contains a format that is either supplied by SAS or created using the FORMAT procedure. The format name must contain a period (for example, dollar6. or dollar8.2).
specifies the type of the format:
| 'C' | |
| 'N' |
| Details |
If the specified format is not known to the SAS session, then the operation is unsuccessful. The function verifies that valid widths are specified for formats.
See SAS Language Reference: Dictionary for details about formats.
| Examples |
Assume that you want to use the $CHAR12. format and to verify that $CHAR12. is a valid character format. (If the format name is valid, then the value returned to the variable RC is 1.)
rc=format('$char12.','c');
Verify that 5.6 is not a valid format for numeric values. (If it is not valid, then the value returned to the variable RC is 0.)
rc=format('5.6','n');
| See Also |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.