Replying to myself, I know, bad form...
Anyway, here's my improved version which parses Q VSWITCH DET
SAY "Listing home addresses for all VSWITCH clients";say
ADDRESS COMMAND /* requires PIPE to be capitalised */
'PIPE (end ?) cp q vswitch det', /* display the VSWITCH */
'|a: find VSWITCH', /* find the switch name*/
'|spec w2-3 1', /* name is words 2 & 3 */
'|insert /Switch: /', /* insert prefix */
'|console', /* show collected input*/
'?a:', /* look for clients */
'|l: locate /Adapter Owner:/', /* find the client */
'|spec w3 1', /* save their name */
'|pad 12', /* pad it with blanks */
'|f:faninany', /* get other input */
'|join', /* join into table form*/
'|console', /* show collected input*/
'?l:', /* find home address */
'|pick from after word 1 == "Unicast" count 1', /* after Unicast*/
'|spec w1 1', /* save home address */
'|f:' /* go and show it */
Output on my system edited for privacy but you get the idea:
vsho
Listing home addresses for all VSWITCH clients
Switch: SYSTEM name-changed-for-privacy-1
Swi1Host1 Add1-changed-for-privacy
Swi1Host2 Add2-changed-for-privacy
Swi1Host3 Add3-changed-for-privacy
Swi1Host4 Add4-changed-for-privacy
Switch: SYSTEM name-changed-for-privacy-2
Swi2Host1 Add1-changed-for-privacy
Swi2Host2 Add2-changed-for-privacy
Swi2Host3 Add3-changed-for-privacy
Swi2Host4 Add4-changed-for-privacy
Ready;
Pipes are very neat and I would love to have them on my TSO systems but am not
holding my breath...
Kind regards,
Peter Bishop
System Programmer - Mainframe
From: Bishop, Peter
Sent: Friday, March 15, 2019 09:40
To: CMSTSO Pipelines Discussion List <[email protected]>
Subject: v6.4 filter for VSWITCH output
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.