If there's only a couple of other execs that invoke the submission
exec, I would pass an extra parameter or option to the submission
exec.  For example:
   if word(arg(1),1)='$*subexec*$'
     then parse upper arg asSubExec fn ft fm '(' options
     else parse upper arg fn ft fm '(' options '' asSubExec
  ...
   if AsSubExec<>'' then ...
This method is easy to code: just one extra parameter in front of
everything else, one one strips it off in the called exec.  I use this
often.

2007/12/27, Wakser, David <[EMAIL PROTECTED]>:
> Kris:
>
>         In order to clarify things, I have just finished writing a
> "suite" of EXECs to handle compilations/assemblies and job JCL being
> sent to multiple VSE machines on multiple different physical machines.
> All of the EXECs that build JCL use a "common" submission EXEC.
>
>         The submission EXEC is somewhat complicated, since I need to
> "override" certain JCL items and change them, to ensure return of the
> output to the user. The scenario is somewhat convoluted: the client's VM
> runs second-level to "our" VM. The VSEs are scattered; one also runs
> under "our" first-level VM, while others are on DIFFERENT CPUs running
> DIFFERENT VMs. I am using VSE's autoFTP feature to return output to the
> original CMS user, and I am doing that by modifying JCL during the
> submission process to ensure it contains the required parameters to make
> that happen.
>
>         The "submission" EXEC can be invoked from an EXEC, but it can
> also be invoked on its own. In the submission EXEC, I need to know if I
> was invoked natively (either from the CMS command line or from FLIST - I
> don't differentiate), or called from another EXEC. This is necessary in
> order to decide whether or not to display certain messages.
>
>         Does that explain my need a little better? For now, I am using
> the following to accomplish this:
>
> PARSE UPPER SOURCE . . . . . RXNAME .
>  'PIPE STORAGE 740 8 | XLATE 1-* UPPER | VAR X1'
> if X1 /= "SEND2VSE" & substr(X1,1,5) /= "FILEL" then exit
>
> SEND2VSE is the name of the submission EXEC. That is what is returned if
> the EXEC is accessed natively. If issued from FILELIST, then FILEL is
> returned. If neither of those is returned, I assume the submission EXEC
> was called by another EXEC (for example, the compilation exec) and I
> exit at this point.
>
> David Wakser

-- 
Kris Buelens,
IBM Belgium, VM customer support

Reply via email to