Hi Art I ran the above code, while it does return percents, I don't think they are correct apparently. They are similar to running proc freq actually. By using the below code (following using your original code), I was able to include the freq number (#1 above), the percent (#2 above), and the startyear/county combination number (#5 above) in one data set (http://www.nycourts.gov/surveys/cwcip/agerange1-11-13-12.zip). The problem is that I cannot get the cumulative number (#3 above) and cumulative percent (#4 above). Do you or anyone know how to start at the top of a data file and cumulatively add the values of a column from 1 record to the next record and populate the cumulative number in a new column for each record? This calculation needs to be done situationally--when the previous and current record have the same county, year, exit values. Paul proc freq data=s1ageshort; tables cnty_name*startyear/out=s1ageshortyearfreq /*this is the total per cnty_name,startyear combo*/; run; proc sort data=s1ageshortyearfreq out=s1ageshortyearfreqsort; by cnty_name startyear; run; proc sort data=s1ageshorttest out=s1ageshorttestsort; by cnty_name startyear; run; data s1ageyear1; merge work.s1ageshortyearfreqsort (keep=count cnty_name startyear rename=(count=cohortyearcount)) work.s1ageshorttestsort (drop=percent); by cnty_name startyear; Percent1=count/cohortyearcount /*this is the percent*/; run;
... View more