ekempter:
Well, if you are running your SQL statements interactively (meaning from STRSQL from the command line), you can press F13, select 1. Change session attributes and SELECT ouput "3=File" to store the results of your interactive select in a table defined on this screen.
If you want to pass the command in an SQL, you could do the following:
CALL QCMDEXC ("commandstring", LENGTH)
Be sure to use 15,5 formatting for the length.
For example, interactively from STRSQL, you could do the following:
CALL QCMDEXC("wrkactjob",0000000009.00000)
So, you could conceivably do a CRTDUPOBJ in the parameter of CALL QCMDEXC.
Just my two cents worth.
I am sure there is a better way.
Roby