Unload the Table data to Flat file. Read this flat file until End of file ,write the record to sysout.
In File control,
Select Infile assign to XXXXX.
Select Outfile assign to SYSOUT.
and Other logic is: (We can do below logic also But this is not good way...)
Declare Cursor with select * from Table.
Put the Fetch Cursor loop Until end-of-table(or SQL code=100)
Move the Table values to output file variables, write the output file.