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.

PIPE SORT<br />

Usage Notes<br />

Examples<br />

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

And, the messages are passed to the output stream in the following order:<br />

This is message number two<br />

This is message one<br />

PAD can be in either of the following <strong>for</strong>ms:<br />

'nn'X<br />

X'nn'<br />

Each n is a number 0-9orcharacter A - F.<br />

position.length<br />

The starting position and number of characters defining the sort field.<br />

Position indicates the starting character within the message. By default, position<br />

is counted from the first character of the message.<br />

Position can be any positive number.<br />

Length is an unsigned positive number indicating the number of characters<br />

from position to be included in the sort field. An asterisk (*) can be specified <strong>for</strong><br />

length indicating that all characters after position are to be used. Position<br />

without length and the period (.) separator default length to 1.<br />

If length is larger than the available characters, all available characters are used<br />

and the PAD value is used to pad the sort field to the required length.<br />

Consider the following message:<br />

PIPES CAN BE FUN!<br />

This ... Results in ...<br />

7.6 CAN BE<br />

9.20 N BE FUN!<br />

8 A<br />

Up to eight sort fields can be specified. Sorting comparison proceeds from left<br />

to right order with the later fields only being considered if the previous are<br />

equal. Fields can overlap, but doing so causes additional processing time.<br />

v SORT cannot be the first stage.<br />

v CASEI cannot be used with SORT.<br />

v RESET during SORT processing can yield unpredictable results.<br />

v SORT is stable. If identical sort fields are specified, sorted messages are kept in<br />

the same order.<br />

Example: Sorting Messages<br />

This example shows three messages sorted by SORT A 1.3 5.1 10.2:<br />

One message<br />

One more message<br />

Another message<br />

The three sort fields <strong>for</strong> each of these message are:<br />

Onemge<br />

Onemme<br />

Anohes

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

Saved successfully!

Ooh no, something went wrong!