Previous Topic

Next Topic

Book Contents

Book Index

Parsing Words

Scanning is performed from left to right and words in the string (leading and trailing blanks excluded) are matched one by one with the variables named in the template. The last variable named in the template will contain the remaining part of the string, including leading and trailing blanks.

Up to 30 variable names can be specified in a parsing template.

The following situations can be encountered:

Example

The DO SET statements below (which include a %%$PARSE function)

DO SET=%%S = THIS IS A SAMPLE STRING

DO SET=%%T = A1 A2 A3

DO SET=%%$PARSE %%S %%T

have the same result as the following DO SET statements:

DO SET=%%A1 = THIS

DO SET=%%A2 = IS

DO SET=%%A3 = A SAMPLE STRING

Parent Topic

%%$PARSE