/* nov17.ex2 */ /* revisions of oct02.ex3, oct03.ex1 */ /* */ /* create list of current files and */ /* get station names, lat, lon, etc */ /* */ options ls=80 ; /* call operating system */ x "dir J:\unity.ncsu.edu\lockers\dept\stat\courses\monahan\st590g\newsnow c:\temp\todaylist" ; options symbolgen ; %macro jlatlon ; data _null_ ; length fname $30 stname $15 ; infile "c:\temp\todaylist" ; input @38 fname ; if( left(fname) eq 'bytes' ) then stop ; stname = scan(fname,1) ; * first word ; call symputx('stn'||left(put(_n_,4.)),stname) ; call symputx('howmany',put(_n_,4.)) ; run ; /* read lat/lon head for practice */ /* */ %do count = 1 %to &howmany ; data b ; infile "~/wcourses/st590g/newsnow/&stn&count...dat" firstobs=5 ; input station name $ @45 altitude lat lon ; output ; stop ; * just one observation ; run ; proc append base=stations data=b ; run ; %end ; /* end macro loop */ /* print top */ proc print data=stations ; title 'header information' ; run ; /* done */ %mend jlatlon ; *****************end of macro ; /* */ /* invoke macro */ %jlatlon ; /* call operating system */ x "erase c:\temp\todaylist" ;