&HIER
The &HIER function provides user access to the NetView® hardware monitor hierarchy data associated with an MSU.
&HIER has the following syntax:
where:
- n
- Specifies the index number (1 - 5) of a specific name/type pair.
Note:
- &HIER without n returns a resource
hierarchy slightly different from that found in BNJ146I messages.
The name/type pairs look like:
The letters represent the resource name and numbers represent the resource type.aaaaaaaa1111bbbbbbbb2222....eeeeeeee5555The hardware monitor defines from one to five name/type pairs. Each name is eight characters long and each type is four characters. The names and types are padded with blanks if necessary.
- &HIER with n returns the name/type
pair, such as
aaaaaaaa1111that corresponds to n. If no name/type pair corresponds to n, then a null value is returned. - &HIER returns null under the following conditions:
- If the command list is not run by the automation table
- If the automation table was not driven by an MSU
- If the MSU does not have a hardware monitor resource hierarchy
- You can test whether a resource is present in a resource hierarchy by using the example NetView command list language parsing template shown in Figure 1.
- If a complex link exists in a resource hierarchy, resource levels that are not displayed in the information returned by the &HIER function might exist. You must use a system schematic to determine the complete hierarchy configuration when a complex link is present.
*
* Set up variables for search
*
&RESNAME = AAAA
&RESLN = &LENGTH &RESNAME
&SOURCE = &HIER
&SOURCLN = &LENGTH &SOURCE
*
* Check for existence of Hierarchy
*
&IF &SOURCLN = 0 &THEN -
&GOTO -NOTFOUND
*
* Parse out desired resource name with PARSEL2R
*
PARSEL2R SOURCE FIRSTSEG /&RESNAME/ LASTSEG
*
* If the last segment is non null, we found the resource name
* imbedded in the hierarchy.
*
&IF &LASTSEG = '' &THEN -
&GOTO -CKLAST
&GOTO -FOUNDMSG
*
* Check last segment of the hierarchy for desired resource name.
* (If the desired resource name is the last entry in the hierarchy,
* PARSEL2R will not detect it. We need to make a special check for
* the last entry.)
*
-CKLAST
*
* Trim any trailing blanks
*
-TRIMBLANK
&LASTCHAR = &SUBSTR &SOURCE &SOURCLN 1
&IF &LASTCHAR ¬= ' ' &THEN -
&GOTO -OUTTRIM
&SOURCLN = &SOURCLN - 1
&IF &SOURCLN > 0 &THEN -
&GOTO -TRIMBLANK
-OUTTRIM
*
&IF &SOURCLN < &RESLN &THEN -
&GOTO -NOTFOUND
&INDEX = &SOURCLN - &RESLN
&INDEX = &INDEX + 1
&LASTENT = &SUBSTR &SOURCE &INDEX &RESLN
&IF &LASTENT = &RESNAME &THEN -
&GOTO -FOUNDMSG
&GOTO -NOTFOUND
*
* Issue found message
*
-FOUNDMSG
&WRITE THE RESOURCE &RESNAME EXISTS IN THE HIERARCHY
&GOTO -LAST
*
* Issue not found message
*
-NOTFOUND
&WRITE THE RESOURCE &RESNAME DOES NOT EXIST IN THE HIERARCHY
*
* Exit
*
-LAST
&EXIT
