well, try something simple like this for the cumulation: > data returns; > set crsp.msf; /* this is our master dataset of returns/prices */ > logret = log(1+ret); > keep cusip date logret; > > proc sort; > by cusip date; > > proc means; > var ret; [I think he meant logret here -- doncram] > by cusip; > output out=final sum=lcumret; > The output dataset, final, now has summed log returns by cusip in variable LCUMRET [ie, final looks like CUSIP _TYPE_ _FREQ_ LCUMRET] > > data cumulate; > set final; > cumret=exp(lcumret); > keep cusip cumret; /* this drops lcumret, and the _type_ and _freq_ > created by proc means */ > > proc print; Now, suppose you wanted to do the same thing by years. Define a YR variable, and do the proc sort with a BY CUSIP YEAR and means with a CLASS CUSIP YR -- The only difference will be you'll get extra observations in the output dataset with _type_ set to different values-- discard the irrelevant ones.