- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
can anybody tell me the difference between find() and index() giving an example.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
find() -
"The FIND function searches string for the first occurrence of the specified substring, and returns the position of that substring. If the substring is not found in string, FIND returns a value of 0.
If startpos is not specified, FIND starts the search at the beginning of the string and searches the string from left to right.
If startpos is specified, the absolute value of startpos determines the position at which to start the search.
The sign of startpos determines the direction of the search."
index() -
Syntax |
INDEX(source,excerpt) |
"The INDEX function searches source, from left to right, for the first occurrence of the string specified in excerpt, and returns the position in source of the string's first character. If the string is not found in source, INDEX returns a value of 0.
If there are multiple occurrences of the string, INDEX returns only the position of the first occurrence."
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
find() -
"The FIND function searches string for the first occurrence of the specified substring, and returns the position of that substring. If the substring is not found in string, FIND returns a value of 0.
If startpos is not specified, FIND starts the search at the beginning of the string and searches the string from left to right.
If startpos is specified, the absolute value of startpos determines the position at which to start the search.
The sign of startpos determines the direction of the search."
index() -
Syntax |
INDEX(source,excerpt) |
"The INDEX function searches source, from left to right, for the first occurrence of the string specified in excerpt, and returns the position in source of the string's first character. If the string is not found in source, INDEX returns a value of 0.
If there are multiple occurrences of the string, INDEX returns only the position of the first occurrence."
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thank you sir
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
So don't leave this topic hanging. Mark the solution response, however "trivial".
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------