Two suggestions, both involving using a temp file:
(a) use echo *JOB user.acct;outclass=,,1 >> jobfile
echo *file somefile=thatfile.pub >> jobfile
(etc)
echo *EOJ >> jobfile
stream jobfile,*
(b) If you need to do "in-line" variable substitutions the above may work
best for you, but there are a few "shortcuts" to avoid all the 'echo's:
1. Be sure your command file ends with a 'return', then append any other
fixed JCL to the end. You can then FCOPY...;SUBSET= to select them.
2. Build a short stream file which just invokes the command file in
batch. You can then do your "tricks" by checking if you're in session
or batch and act accordingly.
[\] Jeff Kell, [log in to unmask]