options linesize = 72 ; data dogs ; input name $6. @8 bdate mmddyy8. @17 sex $2. @20 adopt mmddyy8. ; format bdate adopt date8. ; datalines ; Mickey 05/06/87 NM 08/02/87 Donald 11/02/87 NM 05/01/88 Kiri 07/01/97 SF 08/18/98 Lucy 07/01/98 SF 06/03/00 ; proc sort data = dogs ; by name ; run ; proc print ; run ; data expenses ; input name $6. @8 pdate mmddyy8. @17 category $12. @30 amt ; format pdate date8. ; datalines ; Mickey 09/05/01 meds 28.00 Lucy 09/15/01 trial entry 80.00 Kiri 09/20/01 toenail cut 5.00 Lucy 09/20/01 toenail cut 5.00 Kiri 09/25/01 meds 82.00 Mickey 09/30/01 toenail cut 5.00 Mickey 09/30/01 food 33.59 Mickey 10/05/01 meds 28.00 ; proc sort data = expenses ; by name ; run ; proc print ; run ; data combine ; ***************************************************; * Insert below the code required to merge the *; * dogs dataset and the expenses dataset so that *; * the resulting dataset: *; * contains all variabless from both datasets *; * does not include records for dogs who have *; * no expenses in the expenses dataset *; ***************************************************; run ; proc print data=combine ; run ; %macro maketable(stats, classv) ; proc tabulate data=combine ; class &classv ; var amt ; table &classv all, amt * ( &stats ) ; title "Dog Expenses by &classv" ; run ; %mend ; ****************************************************; * Insert below the code required to use the macro *; * to produce the two tables on the output provided *; ****************************************************;