Previous Topic: HWS SENDCMD—Sends command to HiSrvNext Topic: HWS SETATTR— Update the value of a system attribute


HWS GETATTR— Get the value of a system attribute

The ADDRESS HWS GETATTR command lets you retrieve the value of a single attribute from a specific target.

This command has the following format:

ADDRESS “HWS GETATTR keywords”

/*required keywords */
{ATTR(name of attr)} 
{ENTITY(list of entities)} 
/* optional keywords */
[DEBUG(YES|NO)]
[REFRESH(YES|NO)]
[TIMEOUT(value)]
ATTR

ATTR specifies the name of the target attribute to be updated. These names are derived from the attribute names used by BCPii.

REFRESH

REFRESH defaults to NO, if REFRESH(YES) is specified HiSrv calls to BCPii to get the updated value.

COMMON KEYWORDS

ENTITY, DEBUG and TIMEOUT are keywords common across every HWS command, and are defined in section ADDRESS HWS Common Keyword.

Examples: HWS GETATTR

This example gets the value of the attribute CPCVERSION and returns it in the REXX variable HWS.CPCVERSION. The command forces BCPii to go out and get the most updated value, times out after five seconds, and creates debugging messages.

ADDRESS HWS "GETATTR ATTR(‘CPCVERSION’) ENTITY(CPC(‘SAMPLE.IBM.CPCNAME’)) DEBUG(YES) REFRESH(YES) TIMEOUT(5)"
Return information from GETATTR

The REXX variables HWSRC and HWSRS contain the address environment return and reason codes respectively. A REXX variable containing the attribute value is returned. The variable has the name structure HWS.attribute_name where the attribute name is the character string that is specified in the ATTR keyword. For example, a request for the attribute CPCNAME would be returned in the REXX variable HWS.CPCNAME. The format of the value in the variable is different depending on the data type of the variable. Attribute data types include:

Binary

This data type is a fixed or variable length binary values, they are returned as hex value strings.

Boolean

True and False values that are returned as either the character string ‘TRUE’ or the character string ‘FALSE’.

Character Strings

This data type is a fixed or variable length strings of characters and is returned as such.

Handler

A BCPii attribute type that is not supported so a hex representation of the binary attribute value is returned.

IP Address

A BCPii attribute type that is not supported so a hex representation of the binary attribute value is returned.

Signed Binary Number

Returned as a signed integer value in the range -2,147,483,648 through 2,147,483,647.

Unsigned Binary Number

Returned as a positive integer value in the range 0 through 4,294,967,295.

Unknown Binary Value

The type for a BCPii attribute that is undocumented or not identifiable. Unknown binary is not supported so a hex representation of the binary attribute value is returned.

Note: All attributes are returned in the format that is required for the ATTRVAL keyword in the SETATTR call.