SLOCP
Top  Previous  Next

(SLOCP(TextNoteVarcharValue,string,occurrence))

Locates the exact position of a given string and occurrence in a TEXT, NOTE or VARCHAR value, returning the position if the string is found, 0 if it is not found. Using -1 as the third parameter will return the LAST occurrence.

In the following example, the value of vslocp1 is 1.

SET VARIABLE v1 VARCHAR = 'ABCDEABC_AB'  
SET VARIABLE vslocp1 = (SLOCP(.v1,'AB',1))  


In the following example, the value of vslocp2 is 6.


SET VARIABLE v1 VARCHAR = 'ABCDEABC_AB'  
SET VARIABLE vslocp2 = (SLOCP(.v1,'AB',2))