If you are to use your output to build a "dynamic" SQL WHERE condition, it does not matter if you have the values in a single record or in multiple records. In fact it is pretty much easier to write it in multiple records.
My suggestion was to use the OUTFIL BUILD to format your data records which in turn will write the actual search values in your WHERE clause. And use the HEADER1 and TRAILER1 parameters in the OUTFIL to write the open and close parantheses respectively, but the last value in the WHERE should not have a comma suffixed to it and hence the trick with the TRAILER1 with dummy-end value.
As has been pointed out already, this is much more sensible to do over several lines.
Borrowing a Smart Trick, here is a DATASORT solution.
Yes, then does mean sorting the file, but since it is values for a WHERE clause, I'm assuming there aren't going to be hundreds of thousands of input records.
DATASORT allows you to specify "header records" (FIRST(n)) and "trailer records" (LAST(n)) which retain their original relative positions in the file whilst everything in between is sorted.
With DATASORT you get OPTION EQUALS for nothing. So the "data" can be sorted on the first byte (which by that time is always a single-quote) and the records even stay in the same order. The "non-trailer" records get a comma after the closing quote, the "trailer" record does not.