The STRING statement allows the programmer to concatenate several fields together into one field. The DELIMITED BY clause allows the programmer to specify a character or characters that mark the end of the field. The STRING will take only those characters that precede the character(s) in the DELIMITED clause and move them to the INTO field (receiving field). Note that the delimiter is a character literal enclosed in quotes. DELIMITED BY SIZE means that the entire field is brought over to the INTO area. The first data to move into the INTO/receiving field moves against the left wall of the field. The next sending field moves data in immediately to the right of the data that is already there etc.

The POINTER option means that the data moves into the INTO field starting at the position specified by the pointer. The pointer is incremented by 1 every time a character is moved into the INTO area. Obviously pointer cannot be 0 or a negative number and it cannot exceed the length of the INTO/receiving field. The ON OVERFLOW option allows you to specify what to do when a problem occurs. The problem can be that the end of the INTO/receiving field has been reached and there is still data to be moved or that the pointer field is out of range. If there is no ON OVRFLOW then the STRING or UNSTRING is abandoned and processing moves to the next logical instruction.

The UNSTRING statement allows you to take the data in one field and break it out into several fields. With the UNSTRING, again only the characters that precede the character(s) in the DELIMITED clause are moved to the fields specified in the INTO. Looking at the layout for the verb, you can see it has several options. The ALL clause means that two or more of the character specified as a delimiter will be treated as if there was only one and none of the delimiter characters will be moved to the INTO/receiving fields. Notice that you can have an OR so that you can check to see if the delimiter is one thing or another. If you want to keep the delimiter you can use the DELIMITER in clause to receive the character that was found and used as the delimiter.

There is also a COUNT IN option that allows the programmer to count the number of characters that get moved into the INTO/receiving field. You can specify a different count field for each of the receiving fields. The WITH POINTER option can designate a position in the sending field that will be the first character that is sent. This means if the pointer is 5, the first four characters will not be sent. Every time a character is sent to the receiving field, the POINTER is incremented by 1. The TALLYING IN option counts how many of the receiving fields actually used. This usually means received data but if there were two delimiters next to each other and you didn't use the all you could conceivably end up with an empty field that would be counted as used. The ON OVERFLOW will be used when all of the data cannot be unstrung successfully or the pointer is out of range.