As one is extending on this subject...
1. when queuing commands to make XEDIT perform the work, don't forget to start
XEDIT with the NOPROF option, otherwise you are uncertain about
what a PROFILE
XEDIT might cause.
2. Good point to ask for a helper macro with another name. This is
often forgotten
and causes often grief indeed. But....
3. Instead of coding an EXEC and a macro, make a selfcontained exec. Example
SENDINV EXEC:
/* */
parse source . . myname .
if arg(1)='$$Xedit$$' then signal XEDIT
address command
...... perform startup things, like parsing args ...
push 'COMMAND CMS EXEC' myname '$$Xedit$$' /* Prep calling us again */
'XEDIT some file (NOPROF'
exit
XEDIT: /ยจ* now we are called as "subtask", but with XEDIT alive */
address XEDIT
.... the commands XEDIT needs to do ...
When the XEDIT section of the exec needs parameters of the invoking
exec, one has several choices: store them in GLOBALV, use PIPE VAR xxx
1 to get them, pass them
as argument in the stacked EXEC request, ....
Selfcontained execs can be used as Pipe subroutines too:
parse upper source . . myname mytype . syn addr .
if addr=? then signal SubPipe
'PIPE ..... !REXX('myname mytype') xxxxxx !......
.....
SubPipe:
parse arg what rest
Select
when what='CHAN' then signal Channels
when what='CHPID' then signal QueryChpid
when what='XRANGE' then signal XRANGE
Otherwise signal calculate
end
2008/4/16, Phil Smith III <[EMAIL PROTECTED]>:
> Tim Joyce wrote about using:
> >Queue "ALL /INVALID"
> >Queue "SET SHADOW OFF"
> >Queue "PUT * = INVALID A1"
> >Queue "QQ"
>
> Notwithstanding the other excellent suggestions (PIPE, using a macro, etc.),
> I'd note a couple of things:
>
> 1) A closing slash on the ALL would avoid possible issues from file format
> 2) I'd be happier, given programmed execution, to see COMMAND in front of
> most of those commands and MACRO in front of ALL
> 3) In macros (which this isn't, yet), I suggest using:
> 'COMMAND SAVE'
> 'COMMAND PQUIT' rc
> whenever it's important to know whether something worked. That lets you
> produce an error if the SAVE fails for some reason.
>
> Also note that QUIT is synonymed to PQUIT, and QQUIT to QUIT, by default;
> understanding this avoids some confusion once you get rigorous and start
> using COMMAND.
>
> A final note: if you *do* things like this using an XEDIT macro, I advise
> having the macro named slightly differently from the EXEC.
>
> For example, if the example above was called from SENDINV EXEC, the macro
> might be called $SENDINV, or SENDINV$. This avoids problems if you try to
> invoke the EXEC from XEDIT ...
>
> ...phsiii (pedantic this morning) (yeah, yeah... "THIS morning??!")
>
--
Kris Buelens,
IBM Belgium, VM customer support