On 09/09/2011 01:02 PM, John P. Hartmann wrote: > Reading a record would surely tell you whether there is more. Or is > your query whether there will be a record tomorrow?
Just the opposite: It's whether I can get a record right now without waiting for "tomorrow" (after the next query is issued). Hmmmm, I didn't see the note about the streams used by SQL EXECUTE, about how it writes to each defined output in turn. That doesn't solve my hypothetical problem (and allow me to leave my REXX stage alone), but it made me curious: If I know the maximum number of SELECTs in the input file, could I just define that many streams for SQL and read from each one in turn until I get something, then read that one to the end? Doesn't seem to work. This stalls if there's no record to peek: "addpipe (end /) *: | s: sql execute | *.in: / s: | *.in.1:" "peekto" ¬R