/* aug25.ex4c */ /* ********** corrected version *****/ /* *** but still a subtle problem ***/ /* */ /* read Amy Nail's test file */ /* compute running means and let */ /* proc means compute daily max */ /* */ /* make pointer to directory */ /* */ libname amy '.' ; * already at the directory ; /* */ /* two step process */ /* make 8-hour rolling ave's */ /* then means to get max */ data a ; drop co ald2 hourlst ; format datelst date9. ; * careful here ; set amy.smoke36_forjm ; cor8ave = (co + lag(co) + lag2(co) + lag3(co) + lag4(co) + lag5(co) + lag6(co) + lag7(co))/8 ; alr8ave = (ald2 + lag(ald2) + lag2(ald2) + lag3(ald2) + lag4(ald2) + lag5(ald2) + lag6(ald2) + lag7(ald2))/8 ; if( hourlst gt 6 ) then output ; * only after 7 ; run ; /* */ /* proc means for each day's max */ proc means data=a max noprint nway ;* nway !!!! ; class grid36id datelst ; var cor8ave alr8ave ; output out=b max= ; run ; /* */ /* print the top */ proc print data=b (obs=20) ; title 'top of dataset' ; run ; /* */ /* print the bottom */ proc print data=b (firstobs=10900) ; title 'bottom of dataset' ; run ;