REXX compound variables are composed of two parts, the stem, which ends in a period, and the tail. The stem begins with the first character of the variable and goes up to and includes the first period. The first period is part of the stem and the tail follows the stem. Most of the time you'll see or use an important element in the tail of a compound variable. But each compound variable tail may have many elements, each separated from the others by period. The period itself is not part of the element. Each element may be one of three things. A simple REXX, variable in an effort selfer, constant like a number or a null. Keep in mind, compound variables are not arrays. Compound variables have some very special properties in which you can take advantage, which simple variables do not, and let's look at the first very cool thing that REXX does with compound variables, and it involves the stem. You know how, when you use a variable in REXX, if you haven't somehow assigned a value, the value defaults to his own name in uppercase. Well, these are called uninitialized variables. Now compound variables work a little differently. If you assign a value to the stem of a compound variable then every other compounds variable that you use in an exec, which has the same stem, would automatically is assigned the value for stem. They do not default to their own names in uppercase. In the example here on the visual, we are assigning the compound variable stem day. Don't forget the period which is part of the stem itself. We're assigning it to Monday. From this point onward, every compound variable using this exec, which begins with day, also has the value Monday, unless that individual compound variable is assigned to some other value. So day.6 holds what value and day.17 and day. [inaudible] , day.table,.chair,.floor,. ceiling. What do they hold? The answer is they hold the value of Monday. In this example, we are assigning these stem day period to the value Monday and the compound variables day.2 and day.3 to the values Tuesday and Wednesday respectively. If later on in the exec we use the compound variables at the bottom of the visual, what values would they hold? Well, day.1 would hold value Monday as would day.6, they hold Tuesday, day.table. But what about day.2? Well, we have an explicit assignment for the compound variable day.2 and that's Tuesday. So day.2 equals Tuesday and how about day.2.3? You might be surprised to learn that that has a value of Monday. Why? Well, this is my compound variables are not arrays. In a typical array processing, if day.2 were assigned the value Tuesday, then day.2. should also be Tuesday. But with compound variables, the unassigned variable always default back to the value of the stem. In the example here, we are assigning a stem month period to the value no such month. We are actually learning a predefined error message into the stem. Then we assign the variables month.1, month.2, and so on for the 12 months of the year, to the month names. Later in the exec, whenever we use a compound variable with a valid month number as the tail, it resolves to the correct month name. But if we use the compound variable with a tail having any value other than the 12 month numbers, we automatically pick up and use the step value, which is our predefined error message. Pretty cool. Now we said earlier that the element of a compound variable may be one of three things as simple variable, a constant or a null. If an element of the tail is a simple REXX variable, then REXX resolves that simple variable with its value, plugs that value back into the compound variable in place of the element, and that value becomes part of the name of the compound variable. REXX will then try to resolve. Now stick with me, REXX does this for each element in a compound variable. No combination of elements will be done. The resulting compound variable name is subjected to the 250 character limitation rule in including the periods that all variables must follow. In the example on the visual, we are again assigning the stem day.2 to the value Monday, and assigning the compound variables day.2 and day.3 to the values Tuesday and Wednesday respectively. We then assign a simple variable cat to the value two. Then we reference the compound variable day.cat. REXX recognizes that the tail of the simple variable, so REXX resolves that simple variable cat with its value 2 and plugs that value back into the compound variable in place of the tail. So day.cat has become day.2 and this is the compound variable that REXX will resolve.The variable day.2 holds a value of Tuesday, so that's what's displayed on the screen. The last two compound variables on the visual are resolved to these values. Day.dog resolves to day.3 and Wednesday, and day.cat.dog resolves to day.2.3 which is an uninitialized compound variable and that was used as the value of the stem and the value is Monday. As interesting and logical exercise as all of this is, one of it doesn't matter. Well, I'll attempt to answer that in the next video. When we look at some of the uses for compound variables.