Parsing is the act of breaking apart one piece of data into separate pieces. For example, let's say that the value of the variable My_Variable is the string This is some data. You wish to break this apart so that each word is assigned to a different variable. You use the PARSE instruction to do this.

By default, PARSE breaks apart data wherever there is at least one blank space. So, the first piece of data that PARSE breaks off of My_Variable's value is the word This. This process is referred to as "tokenization", and so This is the first token (ie, piece). The second token (ie, second piece of data that PARSE breaks off) is the word is. The third token is some, and the fourth (and last token) is data. PARSE trims any leading and trailing spaces from each token that is broken off, except for the last token. (Although one leading space upon the last token is eaten by the parsing process).

One of the following keywords must follow the PARSE keyword: ARG, PULL, VAR, SOURCE, VERSION, LINEIN, or VALUE. Which one you use depends upon where you're getting the data being broken apart, and how you want it broken apart. You can also use the keyword UPPER in conjunction with any of the preceding keywords in order to tell REXX to change all lower case letters to upper case in any tokens that are broken off.