Trivial, but since I felt like playing....
The treatment of filemode may not be what you have in mind, but try this
for starters:

/*
**
*/
Address Command
Arg infn inft infm outhow .
Select
   When Abbrev('DISK',outhow,1) then Do
      outs = '|> SUCCESS FILE A'
      outf = '|> FAILURE FILE A'
      End
   When Abbrev('CONS',outhow,1) | outhow = '' then Do
      outs = '|Spec 1-* n /Erased/ nw|Cons'
      outf = '|Spec 1-* n /*Erase Failed*/ nw|Cons'
      End
   Otherwise Do
      Say "Unrecognized parameter" outhow
      Exit 1
      End
   End
'PIPE (End ? Name Sample1)',
'<' infn inft infm,
'|Pick substr 1.1 of w1 == /D/',
'|Pick substr 1.1 of w2 == /T/',
'|Pick substr 1.1 of w3 == /'infm'/',
'|du:Fanout',
'|Elastic',
'|cm:Spec w1.3 n / / n select 1 w1 nw',
'|de:Pick w -1;-1 == /0/',
'|Spec w1.3 n',
outs,
'?de:',
'|Spec w1.3 n',
outf,
'?du:',
'|Spec /ERASE/ n w1.2 nw substr 1.1 of w3 nw',
'|Not Command',
'|cm:'
Exit Rc
--
Mike Harding
z/VM System Support

mhard...@us.ibm.com
mike.b.hard...@kp.org
mikehard...@mindless.com
(925) 926-3179 (w)
(925) 323-2070 (c)
IM: VMBearDad (AIM),  mbhcpcvt (Y!)


The IBM z/VM Operating System <IBMVM@LISTSERV.UARK.EDU> wrote on 09/20/2010
12:22:59 PM:

> From: Steve Perez <sspe...@corelogic.com>
> To: IBMVM@LISTSERV.UARK.EDU
> Date: 09/20/2010 12:23 PM
> Subject: PIPEline how to question..
> Sent by: The IBM z/VM Operating System <IBMVM@LISTSERV.UARK.EDU>
>
> Hello Listers,
>
> I have the following scenario and would like to know how some of you woul
> d
> go about doing it using REXX Pipeline. If you have an example, that would
>
> be great too.
>
> Scenario:
>
> 1. Read a file ( PIPE < fn ft fm | )
> 2. Select specified records with D* T* fm (format of each row is: fn ft f
> m)
> 3. Issue the CMS command to ERASE the file
> 4. If the ERASE command issued for each file completed successfully, I
>
> want to output the fn ft fm to the CONSOLE with a 'success' message OR
>
> write the fn ft fm to a SUCCESS FILE.
> 5. However if the ERASE command failed for a file, I want to output that
>
> fn ft fm to the CONSOLE with an error message OR write the fn ft fm to a
>
> FAILED FILE.
>
> I know I probably will need to create multistream pipelines.  Can all the
>
> above be performed in one PIPE instance or several PIPE instance?
>
> The above is just a small section of a larger REXX EXEC doing automation
>
> of mini-disk checking of files and clean-up.
>
> Any and all assistance will be appreciated.
>
> Thanks,
> Steve.

Reply via email to