To use point-in-polygon test, give through data statement the locations of points you want to test for being inside of given edges.
For this test, polylines do not have to be closed - they are treated as closed anyway. Points on the polyline or coincident with vertices are assumed to be inside of the polygon.
A data point gets the number of the first of given polygons it is in, or NA otherwise. You can parse the output with tools you have at the hand (grep, awk, Perl...) and select points you are interested in.