Given this set of data, i tried using PROC Report to print all the data with a SUM of AGE(i did MEAN in the code to test between MEAN and SUM). However, when i perform, all i get is duplication of each set of data as you may see below. Need your Kind Advice. Below is the duplication of data which i dont want. input ID $ 1-14 Name $ 16-30 Sex $ 32-33 Country $ 34-45 Nationality $ 46-61 Ocupation $ 62-73 Age 75-78; 990101-14-9900 Yandhi Wong F Nigeria Nigerian Cheerleading 22 881212-10-8811 Nathan Wong M Honduras Nigerian Drug Lord 17 630303-11-6633 Dicky Wong M China Indian Monk 99 660404-14-4444 Grace Wong F Mongolia Mongolian Modeling 44 770707-07-1717 Chin Teck Min M China China Duck Shop 33 920901-09-7777 Wong Hong Qui M Malaysia Malaysian Psychologist 29 880818-10-8888 Teoh Eu Ern F Malaysia Malaysian Kungfu Master 33 A998877 Abdulla Omar F Iraq Iraqi Spy 28 proc sort data=ALFRED.shoes;
by nationality;
run;
proc report data=ALFRED.shoes
/*STYLE(HEADER)=[BACKGROUNDCOLOR=ORANGE FONT WEIGHT=BOLD*/
/*STYLE(SUMMARY)=[(COLOR=WHITE BACKGROUNDCOLOR=GREEN FONTFAMILY=ARIAL FONTSIZE=2*/
/*TEXTALIGH=CENTER CELLWIDTH=1in}*/
;
COL Name Age Country Nationality Agemean;
DEFINE Age /analysis mean;
DEFINE Country /DISPLAY 'Country of Origin';
DEFINE Agemean /COMPUTED 'Age Mean';
DEFINE Name /DISPLAY;
DEFINENationality /GROUP;
COMPUTEAgemean;
Agemean=Age.mean;
ENDCOMP;
COMPUTE Country;
IF Country = 'China' THEN
CALL DEFINE (_COL_, "STYLE", "STYLE=[COLOR=CORNFLOWERBLUE]");
ENDCOMP;
COMPUTE Age;
IF Name ='Dicky Wong' THEN CALL DEFINE (_COL_, "STYLE","STYLE=[COLOR=CHARTREUSE]");
ENDCOMP;
BREAK BEFORE Nationality/ SUMMARIZE;
/*BREAK AFTER Nationality / SUMMARIZE;*/
run; My Result:
... View more