14.03.2014 Views

Using JMP - SAS

Using JMP - SAS

Using JMP - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

404 Formula Functions Reference Appendix B<br />

Character Functions<br />

• a list, length returns the number of items in the list;<br />

• a blob (binary object), the number of bytes.<br />

Num<br />

Produces a numeric value that corresponds to its character string argument when the character string<br />

consists of numbers only. If a character string contains a non-numeric value, the result is a missing value.<br />

For example, Num(“1.123”) evaluates as 1.123.<br />

Substr<br />

Extracts the characters that are the portion of the first argument. Begins at the position given by the second<br />

argument, and ends based on the number of characters specified in the third argument. The first argument<br />

can be either a character column or a literal value. The starting argument and the length argument can be<br />

numbers of expressions that evaluate to numbers. For example, to show the first name only,<br />

Substr("Veronica Layman", 10, 6) starts at position 11 and reads through position 16, which yields Layman.<br />

If start is negative, Substr searches backward from start from the end of the string. If length is negative or<br />

absent, Substr returns a string that begins with start and continues to the end of s.<br />

Substr can also be used with lists.<br />

Trim<br />

Produces a new character string from its argument, removing any trailing blanks. For example, Trim("john ")<br />

evaluates as john.<br />

Word<br />

Extracts the n th word from a character string. One or more spaces define where each word begins and ends<br />

unless the optional delimiters argument is specified. For example, Word(2, "Veronica Layman") returns the<br />

word Layman.<br />

To insert the delimiters argument, click on any argument in the Word function and then click the insert<br />

button on the Formula Editor keypad. Use the delete key on your keyboard or the delete button on<br />

the Formula Editor keypad to remove the delimiters argument. If you do not specify a delimiter, space is<br />

used as the delimiter. If you define the delimiter as an empty string, each character is treated as a separate<br />

word.<br />

Most special characters act as single delimiters. You can enter any character or set of characters to act as a<br />

word delimiter. For example, to extract the last name in the following example, use a comma and blank<br />

together as the delimiting characters and ask for the first word. Word(1, "Layman, Veronica", ", ") returns the<br />

word Layman.<br />

Words<br />

Extracts the words from text according to the delimiters listed in the optional second argument. The default<br />

delimiter is space. For example, Words("the quick brown fox") returns {"the","quick","brown","fox"}.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!