The disadvantage of stacking commands for XEDIT like Richard did is taht one
cannot test the returncode of each command.
Someone may give an example of mixing "address command" and
"address xedit" in the same EXEC, but I don't do that.  If
someone does give such an example, we'll all be richer.

Richard Corak

You asked for it, here a simple example from 1996.  It is not polished as it
was meant to be used only once, but on 20 VM systems.
UPDSCOM  EXEC     A1  V 130  Trunc=130 Size=38 Line=1 Col=1 Alt=0
====>
* * * Top of File * * *
/* */
parse arg abc .
if abc='X$' then signal XEDIT /* Called from XEDIT */

address command
'EXEC LNK MAINT 190 * M Pwd Z'
if rc<>0 then call errexit rc,'LNK failed.'

queue 'UPDSCOM X$'   /* Stack a request to restart us when in XEDIT */
'X SCOMDIR NAMES Z (NOPROF NOSCREEN' /* Start XEDIT */
if rc<>0 then call errexit rc,'XEDIT failed'
'ERASE  SCOMDIR NAMESO Z1'
'RENAME SCOMDIR NAMES Z SCOMDIR NAMESO Z1 (NOUPD'
'RENAME SCOMDIRN NAMES Z SCOMDIR NAMES Z2'
'REL Z (DET'
exit

XEDIT: address xedit
'CASE M I'
'-* FIND :nick.SFS72'
if rc<>0 then do;'COMMAND QUIT 44';exit 44;end
'DUP'
if rc<>0 then do;'COMMAND QUIT 44';exit 44;end
'C /SFS72/SFSESA/1 *'
if rc<>0 then do;'COMMAND QUIT 44';exit 44;end
'COMMAND SAVE SCOMDIRN NAMES Z'
if rc<>0 then do;'COMMAND QUIT 44';exit 44;end
         else 'COMMAND QUIT'
exit rc
ERREXIT: /* general errorexit routine */
parse upper source . . myname mytype . syn .
do i=2 to arg()   /* give errormessages (if any) */
   say myname':' arg(i)
end
exit arg(1)
* * * End of File * * *

--
Kris Buelens,
IBM Belgium, VM customer support

Reply via email to