PARM varname # Create a name of form: "mmmdd" e.g. SEP27, where the day is for yesterday # Handle case where yesterday is end of previous month. if hpdate <> 1 then setvar !varname word(hpdatef,,2)+rht("0"+decimal(hpdate-1),2) return endif # deal with calculating last day of prior month if hpdate = 1 and hpmonth = 3 and hpyyyy mod 4 = 0 then # deal with today being Mar 1 on a leap year setvar !varname "FEB29" else # circularly shift month 'array' and day 'array' right by one entry setvar !varname & word("DEC,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV",',',hpmonth)+& word("31,31,28,31,30,31,30,31,31,30,31,30",',',hpmonth) endif