Thanks for pointing out that SQL is another easy way to solve this problem, and sorry about the frustrations with the editor. You'll be happy to know that in about a month the SAS blogs will move to a new platform that makes it much easier to put code in comments.

The code doesn't make any assumptions on the line (other than finite slope). It works for any line that intersects the bounding box of the data. For example, the code works equally well for the line L(x) = 20 + 0.5 x.