This is the quickest I could come up with.  No, not a PIPE this time.
Restore of IMPCP, VMCONIO and CPCONIO is a task left to the reader.
As opposed to the original code, the command execution order remains
the usual CMS, CP
/* */
trace o
address command
'ERASE $PIPEF$ $TEMP$ A'
'WAKEUP +0 (IUCVMSG'
'SET IMPCP ON'; 'CP SET CPCONIO IUCV'; 'CP SET VMCONIO IUCV'
address cms arg(1) ; src=rc
'CP SET CPCONIO OFF'; 'CP SET VMCONIO OFF'
do until wrc<>5
   'WAKEUP +0 (IUCVMSG QUIET' ; wrc=rc
   if wrc=5 then do
      parse pull 18 ln
      'EXECIO 1 DISKW $PIPEF$ $TEMP$ A3(STRING' ln
   end
end
'WAKEUP RESET'
if src=-3 then say 'Unknown CP/CMS command'
'FINIS $PIPEF$ $TEMP$ A'
if rc=0 then 'XEDIT $PIPEF$ $TEMP$ A'
        else if src<>-3 then say 'No command output'
exit src

-- 
Kris Buelens,
IBM Belgium, VM customer support

Reply via email to