In running the following code, I was hoping to sum "PSW_Hrs" by "PSW_Hrs_Per_Week" categories as defined in the proc format. It turned out, however, some categories ('5<-7 Hrs' and '7<-21 Hrs', specifically) appeared twice in the output. Why and is there a solution without first creating a grouping variable in a data step? Thanks. Jason proc FORMAT; VALUE PSWWkFmt .,0 = 'No Hr' 0<-1 = '0<-1 Hr' 1<-2 = '1<-2 Hrs' 2<-5 = '2<-5 Hrs' 5<-7 = '5<-7 Hrs' 7<-21 = '7<-21 Hrs' 21<-56 = '21<-56 Hrs' 56<-high = '>56 Hrs'; run; proc sort data=MyData; by LHIN_Code PSW_Hrs_Per_Week; run; proc univariate data=MyData; var PSW_Hrs; output sum=Sum_PSW_Hrs out=PSW_Hrs_By_User_Wk; by LHIN_Code PSW_Hrs_Per_Week; format PSW_Hrs_Per_Week PSWWkFmt.; run;
... View more