Hi,

Thought I'd offer this up just for fun.  I made it for a simple view of Q 
VSWITCH xx DET, showing just the home addresses of the connected guests, 
instead of wading through screens of output...

/*-----------------------------------------------------------*/
/*   show the home address of each connected VSWITCH client  */
/*-----------------------------------------------------------*/
ARG sw   .   /* show the home addresses of this switch  */
IF sw = '' THEN EXIT
SIGNAL ON NOVALUE
SAY "Listing home addresses for  "sw        ;SAY
ADDRESS COMMAND   /* requires PIPE to be capitalised  */
'PIPE (end ?) cp q vswitch' sw     'det' ,   /* display the VSWITCH */
    '|l: locate /Adapter Owner:/',           /* find the client     */
    '|spec w3 1',                            /* save their name     */
    '|f:faninany',                           /* get other input     */
    '|pad 20',                               /* make it readable    */
    '|snake 4',                              /* four columns wide   */
    '|console',                              /* show collected input*/
    '?l: |pick from after word 1 == "Unicast" count 1',/* find home*/
    '|spec w1 1',                            /* save home address   */
    '|f:'                                    /* go and show it      */

It gives this output on my 6.4 system, names etc. changed to protect the 
innocent.  Not backward-compatible to v6.3, where it fails on 'pick from' which 
is a very nice improvement.

xsho vswitchname
Listing home addresses for  vswitchname

Host1               Host2               Host3               Host4
IpAddr1             IpAddr2             IpAddr3             IpAddr4
Ready;

Now I'm off to improve it so that it will list them for all defined VSWITCHes 
instead of requiring the name as input, and maybe tabulate the output 
differently.

It's quite nice how easy it is to toy around with pipes until you have 
something worth saving...lots of stumbles along the way but experience is the 
best teacher...

Kind regards,
Peter Bishop

System Programmer - Mainframe



DXC Technology Australia Pty Limited; Registered Office: 26 Talavera Road, 
Macquarie Park NSW 2113 Australia; Incorporated in Australia ACN: 008 476 944.
DXC Technology Company -- This message is transmitted to you by or on behalf of 
DXC Technology Company or one of its affiliates. It is intended exclusively for 
the addressee. The substance of this message, along with any attachments, may 
contain proprietary, confidential or privileged information or information that 
is otherwise legally exempt from disclosure. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended recipient 
of this message, you are not authorized to read, print, retain, copy or 
disseminate any part of this message. If you have received this message in 
error, please destroy and delete all copies and notify the sender by return 
e-mail. Regardless of content, this e-mail shall not operate to bind DXC 
Technology Company or any of its affiliates to any order or other contract 
unless pursuant to explicit written agreement or government initiative 
expressly permitting the use of e-mail for such purpose.

Reply via email to