/* oct02.ex4 */ /* */ /* read current.list file and get */ /* station names */ /* */ options ls=80 ; options symbolgen ; %macro allstations(howmany) ; %do count = 1 %to &howmany ; data _null_ ; length fname $30 stname $15 ; infile "~/wcourses/st590g/newsnow/current.list" ; input fname ; stname = scan(fname,1) ; * first word ; if( _n_ eq &count ) then call symput('this',stname) ; run ; /* */ %let station = %trim(&this) ; %snowsum(&station) ; /* put with others */ proc append base=all data=&station ; run ; /* done */ %end ; * end of macro loop ; %mend allstations ; *****************end of macro ; /* */ /* invoke macro */ %allstations(4) ; /* print results */ proc print data=all ; title 'summaries of all stations' ; run ;