Thanks to all for the contributions to this problem.
I'm actually using SQL to generate the SQL source to the source member.
This is driven from a file which contains table & column information 
extracted from the system catalog. I just use an INSERT INTO lib/file 
(select string ...........) to generate each line. The string is just 
another SQL statement that will be executed through RUNSQLSTM afterwards. 
Sounds a bit complicated, but I was just doing it as an exercise. It 
actually works, except for the fact that the output is greater than 80 
characters.
So each select statement can create only one line of output.
I could always use RPG or CL to break up a longer line into the acceptable 
length, and place the semi-colon on a new line, but I just thought SQL was 
quicker and easier.
As for RTFM. With information spread all over the place these days, I use 
GOOGLE for everything because it gives me a broader range of ideas (and more 
interesting) to solve problems. I just searched in the infocenter again 
(
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp) and 
entered RUNSQLSTM and couldn't find a specific statement re the 80 
characters which I'd presumed was the reason anyway. By the way. Why are 
21st century structures still tied to 80 character punched card antecedents?
Anyway, what I was actually after was a trick to generate two lines from an 
SQL select statement, which I would guess doesn't exist.
Regards, Mike Pantzopoulos
0403 809 442 (mob)
As an Amazon Associate we earn from qualifying purchases.