/* oct02.ex3x */ /* */ /* read current.list file and get */ /* station names */ /* */ options ls=80 ; options symbolgen ; %macro jlatlon(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 symputx('this',stname) ; run ; /* read lat/lon head for practice */ /* */ data b ; infile "~/wcourses/st590g/newsnow/&this..dat" firstobs=5 ; input station name $ @45 altitude lat lon ; output ; stop ; * just one observation ; run ; /* print top */ proc print data=b ; title 'header information' ; run ; /* done */ %end ; * end of macro loop ; %mend jlatlon ; *****************end of macro ; /* */ /* invoke macro */ %jlatlon(4) ;