I have a dataset (file1), in that I have some 10 to 15 strings. And in another dataset (file2) there are thousands of lines. First, I need to read the first string from the file1 and check for it in all the lines of file2. If the string is present in any line (of file2) then write that line into a new file. Then read the second string from file1 and do the same. Do this for all the strings in file1.
You could investigate a PROC SQL join or a SAS data step program MERGE. If you look in the documentation, you will find examples of each of these techniques. Also, there have numerous papers published on these and other similar techniques. You might perform a Google search on performing TABLE LOOKUPs with SAS -- there have been a number of papers that explain how to use the above and other techniques.