phil & tom thanks for your input. i will look at the examples and try to figure it out.
tom, it is for ILERPG. i have not heard of Query Manager. i am fairly new to SQL. that might be a better way of doing it. i am NOT asking you to write the program for me. i can write the program in ILE RPG, just thought it might be easier to user SQL.