To understand the resulting values for the macro variables, we need to know that the ampersand (&) is used to reference the value of a macro variable. The resulting values for the macro variables are:
%let month1 = June; (the value of month1 is "June")
%let month2 = July; (the value of month2 is "July")
%let period1 = &month1&month2; (the value of period1 is "JuneJuly")
%let period2 = May&month1; (the value of period2 is "MayJune")
%let period3 = &month2.Aug; (the value of period3 is "July.Aug")