28.11.2012 Views

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

18 <strong>Programming</strong>: <strong>Pipes</strong><br />

WISHCMD is processing<br />

/*REXX WISHCMD */<br />

/* This procedure uses three PIPE commands<br />

- The first writes a message to a cleared screen<br />

- The second writes a message to a REXX variable.<br />

- The third read the variable and display the result.<br />

------------------------------------------------------------------*/<br />

ADDRESS NETVASIS /* Prevent literals from being upper cased */<br />

’PIPE (NAME WISHCMD1)’, /* Simple message to operator */<br />

’| LITERAL /WISHCMD is processing/’,<br />

’| CONSOLE CLEAR’<br />

/*---------------------------------------------------------<br />

Choose a vacation destination using the PIPE command to<br />

read records from a disk file into the pipeline,<br />

manipulate them and store one resulting message in the<br />

variable named VACVAR.<br />

------------------------------------------------------------------*/<br />

’PIPE (NAME WISHread)’,<br />

’| < WISHLIST’,<br />

’| LOCATE /RIVER/ /PARK/’,<br />

’| NLOCATE /AFRICA/ /ASIA/ /AUSTRALIA/’,<br />

’| TAKE FIRST 1’,<br />

’| VAR VacVar’<br />

/*---------------------------------------------------------<br />

Read variable named VACVAR into the pipeline and add<br />

’vacation choice’ text ahead of it, then display.<br />

------------------------------------------------------------------*/<br />

’PIPE (NAME WISHOUT)’,<br />

’| VAR VACVAR’,<br />

’| LITERAL /Vacation Choice/’,<br />

’| COLLECT’,<br />

’| CONSOLE’<br />

EXIT 0<br />

/*------------------------* End of WISHCMD *-----------------------*/<br />

Figure 13. Pipeline Output from WISHCLST Command Procedure. Created by the pipeline in<br />

Figure 12 on page 17.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!