If you've got fewer CMS commands than PIPE stages, leave the default addressing to 'pipe' and prefix the CP/CMS commands. Like address '' 'IDENTIFY'
Or, what I do in my "self-contained" execs: parse upper source . . myname mytype . syn addr . if addr='?' then signal subpipe address command ...... /*-----------------------------------------------------------------*/ SubPipe: /* Pipe subroutines */ /*-----------------------------------------------------------------*/ parse upper arg fnc opts Select when fnc='PUTFILES' then call PutFiles opts when fnc='CLEVERSEL' then call CleverSel opts Otherwise call ErrExit 89,'Coding error: unknown parm for SubPipe:' fnc end 2010/11/25 Paul Gilmartin <paulgboul...@aim.com> > I have been bestowed (long ago) a sizable (over 1000 lines) > EXEC. I'm considering converting it to a REXX stage so I can > use plumbing; avoid use of temporary files and the dreadful > CMS console stack, replace some EXECIO 1 DISKR with READTO > (or even PEEKTO!), etc. But I'd like to avoid changing code > where it's unnecessary. > > I have a POC: > > /* REXX tiny_2Erexx Thu Nov 25 10:43:48 MST 2010 */ signal on novalue; > trace R > > parse source sys invoked exfn exft exfm cmd env > > STAGE = address() > say c2x( STAGE ) STAGE > address 'COMMAND' > > 'IDENTIFY' > > address value STAGE > 'addpipe < PROFILE EXEC A | CONSOLE' > address > > say address() > return( RC ) > > o Seems to work. But what are the pitfalls? > > o the PIPE command has no syntactic objections to a single-stage > pipeline. Nice. > > o ADDRESS VALUE environment command isn't allowed, so I must use > three instructions instead of one. Rexx limitation. Nuisance. > > o PARSE SOURCE won't return a useful subcommand environment name; > I must use address(). Silly. > > Thanks, > gil > -- Kris Buelens, IBM Belgium, VM customer support