Previous Topic

Next Topic

Book Contents

Book Index

%%$PARSE

The %%$PARSE function is a powerful tool that offers extensive string manipulation capabilities in Control-O AutoEdit environment. This function, which is similar to the REXX PARSE command in the TSO/E environment, can be used to analyze and extract information from various AutoEdit strings, such as messages intercepted by Control-O.

The %%$PARSE function parses a specified string (that is, it splits the specified string into substrings) according to a specified template. A template consists of variables and "patterns" that determine the parsing process.

The format of the %%$PARSE function is

DO SET=%%$PARSE string template

In this format

The %%$PARSE function assigns substrings of the specified string to the specified variables according to the specified template.

The DO SET statements in the above example provide the same result as the following DO SET statements:

DO SET=%%A1=THIS

DO SET=%%A2=IS

DO SET=%%A3=A

DO SET=%%A4=SAMPLE

DO SET=%%A5=STRING

The parsing process involves the following stages:

  1. The string is broken into substrings, from left to right, using the patterns in the template.
  2. Each substring is parsed into words, from left to right, using the variable names in the template.

Template elements are

The rules of parsing are detailed in the following paragraphs.

Parent Topic

Functions