Chapter Contents |
Previous |
Next |
WORDTYPE |
Category: | Command |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
type=WORDTYPE(word-pos); |
Type: Character
Type: Numeric
Details |
WORDTYPE returns the type of the first, second, or third word that is currently on the command line. A word is the text at the current position and up to the end of a leading number or the next blank or semicolon. You can use this function with WORD.
To support custom commands in your application, you must use a CONTROL statement with either the ENTER, ALWAYS, or ALLCMDS option specified. When CONTROL ALWAYS is specified, words entered on the command line that are not valid SAS commands are not flagged in error. See CONTROL for information about the advantages of each CONTROL statement option before deciding which is best for your application.
Example |
Return the type of the four words that are currently on the command line:
w1=word(1); w1type=wordtype(1); put w1= w1type=; w2=word(2); w2type=wordtype(2); put w2= w2type=; w3=word(3); w3type=wordtype(3); put w3= w3type=; CALL NEXTWORD(); w4=word(3); w4type=wordtype(4); put w4= w4type=;
If a user types
ABC = 3 9
on the command
line, then this program produces the following output:
w1=ABC w1type=NAME w2==w2type=SPECIAL w3=3 w3type=INTEGER w4=9 w4type=INTEGER
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.