TS/MP 2.5 Management Programming Manual

Example 5 Obtaining Subsystem Information Program Example
?TACL MACRO
#FRAME
[#PUSH X^ Y^ == variables for zspi and zpwy ddls
read^err io^err reply request == #requester variables
pmon^name == pathmon name from input parameter
result^1 == contains result of ssget operation
result^2 == contains # of tokens ssget returned
result^3 == contains ssget pathway error
] == end push
== Make sure the PATHMON name is provided and that is starts with a "$".
[#IF [#EMPTY %1%] |THEN|
#OUTPUT You must enter the Pathmon name $...
|ELSE|
#SET pmon^name %1%
[#IF NOT [#MATCH [#CHARFIND pmon^name 1 $] 1] |THEN|
#OUTPUT The Pathmon name must start with a "$"......
|ELSE|
== Load the ZSPITACL and ZPWYTACL token definitions. These definitions
== can also be loaded into a TACL SEGMENT file and attached to the users
== environment. This saves considerable time if this macro is used
== regularly. The files ZSPITACL and ZPWYTACL must reside on $DSV.ZSPIDEF.
[#IF NOT ([#FILEINFO/ EXISTENCE / $SYSTEM.ZSPIDEF.ZSPITACL] AND
[#FILEINFO/ EXISTENCE / $SYSTEM.ZSPIDEF.ZPWYTACL]) |THEN|
#OUTPUT *ERROR* Unable to load ZPWYTACL or ZSPITACL definition files..
#OUTPUT *ERROR* Insure that these files reside on $SYSTEM.ZSPIDEF.....
|ELSE|
#OUTPUT Loading ZSPITACL DDL
#LOAD / LOADED X^ / $SYSTEM.ZSPIDEF.ZSPITACL == copy tacl spi ddl defs
#OUTPUT Loading ZPWYTACL DDL
#LOAD / LOADED Y^ / $SYSTEM.ZSPIDEF.ZPWYTACL == copy tacl pwy ddl defs
== Define the SPI buffer.
[#def spi^buf struct like zpwy^ddl^msg^buffer;]
== Set the SSID value, which tells SPI what product you are interfacing
== with.
#SET zpwy^val^ssid [zspi^val^tandem].[zspi^ssn^zpwy].[zpwy^val^version]
== Initialize the buffer (spi^buf) with the SSID (subsystem ID) value and
== the command that is to be executed.
SINK [#SSINIT /TYPE 0/ spi^buf [zpwy^val^ssid] [zpwy^cmd^info] &
/OBJECT [zpwy^obj^pathway]/]
== Initialize the ZPWY^DDL^STATUS^PATHWAY token with null values using
== ZPWY^MAP^STATUS^PATHWAY to determine how each field is to be initialized.
== ZPWY^MAP^STATUS^PATHWAY has the information to determine if the fields
== be nulled to "0" or " ".
SINK [#SSNULL zpwy^map^def^pathway zpwy^ddl^def^pathway]
== To communicate with the PATHMON environment, use #REQUESTER to open the
== Pathway environment. Use #APPENDV to send the request in the SPI
== buffer to the PATHMON environment. Use #EXTRACTV to copy the reply from
== Pathway back into the SPI buffer. Finally, terminate the open request
== to Pathway with #REQUESTER CLOSE.
340 Management Programming Examples