options ls=80; filename tv url 'http://www.tvguide.com/top-tv-shows'; data one; infile tv pad expandtabs; retain rank show network; input @1 chk $char150. @; i1 = index(chk,'class="rank"'); if i1 > 0 then do; ii = i1 + 13; input @ii rnk $3.; wh = index(rnk,'<'); if wh > 0 then rnk = substr(rnk,1,wh-1); rank = rnk + 0; end; i2 = index(chk,'href="'); if i2 > 0 and rank ^= . then do; wh = index(chk,'">'); input @(wh + 2) show $80.; wh = index(show,''); show = substr(show,1,wh-1); end; i3 = index(chk,'class="network"'); if i3 > 0 then do; input @(i3 + 16) network : $8.; wh = index(network,'