you say “using SQL embedded in a JCL” which leads me to think something like DSNTEP2. So the answer is that I am unaware of anyway to do this with a file. HOWEVER, you could use a DB2 table.
SELECT A.FELD1, A.FIELD2, B.FIELD1, B.FIELD2
FROM tableA A, tableB B
where A.acc = b.acc
AND a.acc in ( select column1 from my_table) <—