Variable Names

Variable names designate parts of a message or MSU that you want the NetView program to ignore (when doing the comparison), but to store those parts for use during action processing. You can use the stored variables as command string parameters on an EXEC action with CMD.

During comparison processing, the NetView program ignores any parts designated by variable names and stores each part ignored in the variable name you specify. After setting variables in the IF part of an IF-THEN statement, you can use them in the THEN part of the statement or within a BEGIN-END section for that IF-THEN statement.

A variable name can have up to 16 alphanumeric characters. However, the first character cannot be numeric. You can code up to 25 variable names in an IF-THEN statement, using any names that are not automation-table functions, actions, or keywords. Do not use the same variable name more than once in any one IF condition.

After you define a variable in the IF part of an IF-THEN-BEGIN structure, the variable maintains its value throughout the BEGIN-END section. However, an individual IF-THEN statement within the section can temporarily redefine the value of the variable for its own use by making a comparison to the same variable name.

A variable name can be either character or hexadecimal. A character variable name is one whose value is a set of characters.

The IF-THEN statement in Figure 1 contains the character variable name DATEVAR.

Figure 1. Example of Using a Character Variable Name
IF DOMAINID='CNM01' &
   TEXT='DATABASE HASN''T BEEN PURGED SINCE' DATEVAR THEN
      EXEC (CMD('CLISTA ' DATEVAR) ROUTE (ALL OPERA OPERB));

If the NetView program receives the message DATABASE HASN'T BEEN PURGED SINCE 12/3/10, the NetView program puts the value of the text following the word SINCE, which is 12/3/10, into the variable DATEVAR. Then the NetView program runs CLISTA under both OPERA and OPERB using the value of DATEVAR as a parameter.

The IF-THEN statement in Figure 2 contains the variable name DOMID.

Figure 2. Example of Using Character Variable Name DOMID
IF TEXT='PURGE DATE IS LATER THAN TODAY''S DATE' &
   DOMAINID=DOMID THEN
      EXEC (CMD('CLISTA ' DOMID) ROUTE (ALL OPERA OPERB));

If the NetView program receives the message PURGE DATE IS LATER THAN TODAY''S DATE from domain CNM01, the statement says to put the value of DOMAINID, which is CNM01, into the variable DOMID and run CLISTA under both operators OPERA and OPERB using the variable DOMID as a parameter.

A hexadecimal variable name is one whose value is the hexadecimal representation of the data you assign to it. Specify a hexadecimal variable name with the HEX() keyword.

The example is Figure 3 extracts the generic alert data from an MSU in the variable GENERICDATA. The examples pass the data to a POWEROUT command list in hexadecimal format. Unlike the hexadecimal literal HEX('14'), the hexadecimal variable HEX(GENERICDATA) does not have single quotation marks.

Figure 3. Example of Using a Hexadecimal Variable Name
IF MSUSEG(0000.92 6) = HEX('14') .
   & MSUSEG(0000.92) = HEX(GENERICDATA) THEN
      EXEC (CMD('POWEROUT 'GENERICDATA) ROUTE (ONE AUTO1 *));

The NetView program expands the data assigned to GENERICDATA into a string of EBCDIC characters representing hexadecimal digits (0–9 and A–F) before passing the data to the POWEROUT command list.