/* oct51.ex1 */ /* try espn */ /* third approach -- keep record */ options ls=80 ; data a ; keep line ; * only variable of interest ; length line nline $32767 ; * lengths of char variables ; filename fname url 'http://espn.go.com/college-football/schedule/_/year/2008/week/4' ; infile fname pad lrecl=32767 ; * pad with blanks ; retain open 0 ; * flag for < without > ; input line 1-32767 ; * long line ; line = compress(line) ; rx1 = prxparse("s/<.*?>//") ; call prxchange(rx1,32767,line) ; if( index(line,'Maps') ne 0 ) then do ; output ; * put line= ; end ; lline = lengthn(line) ; if( lline eq 0 ) then delete ; run ; /* print out results */ proc print data=a ; *(firstobs=300 obs=1000); title 'second approach' ; run ;