zhinghur wrote:... JCL doesn't come from anywhere. ...
JCL
always comes from somewhere. I'm sure there are methods for your Rexx exec to create a small JCL job that contains a JOB statement and an EXEC statement containing symbols with your dataset names that calls a JCL procedure that does the heavy lifting. The created job would look something like this -
//MYJOB JOB ...
//MYJCL JCLLIB ORDER=(my PROCLIB)
//MYEXEC EXEC MYPROC,
// INDSN='input dataset name',
// OUTDSN='output dataset name'
MYPROC in your PROBLIB would look something like this -
//MYPROC PROC INDSN='?',OUTDSN='?'
//MYSTEP EXEC PGM=...
//INPUT DD DISP=OLD,DSN=&INDSN
//OUTPUT DD DISP=(NEW,CATLG),DSN=&OUTDSN,...
Obviously the MYPROC procedure would be more complex, but that's beyond the scope of this topic.
There are other ways to do this. For example, I suspect the major job scheduling packages should be able to create and submit the job without you writing a line of Rexx code. This method would be required in virtually all production shops, and this is where your research should lead you, not trying to reinvent a most likely deformed wheel.