The string is scanned from left to right for a substring that matches the string pattern.
The following situations may occur:
The original string is divided into two substrings. The first substring (up to, but not including, the string pattern) is parsed into words using the variables named before the string pattern on the template. Parsing continues from the character following the matched string.
Example 1
DO SET=%%S= THIS IS A SAMPLE STRING
DO SET=%%T= A1 A2 'SAMPLE' A3 A4 A5
DO SET=%%$PARSE %%S %%T
A match is found since the string SAMPLE is part of the original string.
The %%$PARSRC System variThe original string is divided into two substrings while the matched part of the string is excluded. Parsing of the first substring will use the variables listed before the match on the template while parsing of the second substring will use the variables listed after the match:
As a result of parsing
A1=THIS
A2=IS A
As a result of parsing:
A3=STRING
A4=NULL
A5=NULL
It is assumed that a match is found at the end of the string. The first substring consists of the entire string and it is parsed using only the variables named before the string pattern on the template. Parsing continues from the character following the matched string (the end of the string, in this case).
Example 2
DO SET=%%S = THIS IS A SAMPLE STRING
DO SET=%%T = A1 A2 A3 'EASY' A4 A5
DO SET=%%$PARSE %%S %%T
A match was not found. The string 'EASY' does not exist within the original string.
As a result of parsing:
A1=THIS
A2=IS
A3=A SAMPLE STRING
As a result of parsing:
A4=NULL
A5=NULL
Parent Topic |