For the most part. My code is missing the 'put' statement and once I get this working, I will add it in. The put statement will be based on the records that are in a temp dataset (roughly 40,000 ids) and of those ids, I only want the ones that exist in my lookup directory location. Once the code is correct, I should have a put statement of ids that are in my temp data set and also exist in my lookup directory. Basically, I'm trying to build up a 'PUT' statement for student pictures and I only want the ids in my temp dataset and those that are located in the pics directory. I had the file built earlier but once the put statement encountered a file that didn't exist, it bombed.