SYN Statement
The SYN statement enables you to define synonyms for use later in the automation table. A synonym has a name and a value. After defining a synonym, you can use the name of the synonym elsewhere in the table. When you activate the table, the NetView® program substitutes the synonym value for the name.
Synonyms enable you to provide a shorthand notation for long, repetitive strings. Synonyms can also help you modify and maintain an automation table, because you can change a value throughout a table by changing it in one place.
The syntax for the SYN statement is:
SYN Statement >>-SYN-- --%--synname--%-- --=-- --'--synvalue--'--;-----------><
- SYN
- The keyword coded at the beginning of each SYN statement.
- synname
- The name of the synonym, up to 256 characters.
- synvalue
- The value of the synonym.
- The definition of a synonym must precede the use of the synonym in the automation table. You can define a synonym's value only once in the table, but thereafter you can use the synonym as often as you like. Consider defining all synonyms at the beginning of the table.
- You cannot nest a synonym inside another synonym.
- You can use blanks, alphanumeric characters, and other characters
in synonym names and synonym values except as follows:
- Synonym names cannot contain a percent sign (%) or a semicolon (;).
- Synonym values cannot contain a semicolon (;).
- Because single quotation marks are used as the delimiter for the
synonym value, if a synonym value is to contain a single quotation
mark ('), you must represent it as two consecutive single quotation
marks (''). Do not substitute a double quote for two single
quotes. For example, the synonym in Figure 1 contains
single quotation marks. Figure 1. Example of Using a SYN Statement
SYN %LogFullCondition% = 'MSGID= ''IFB040I'''; ⋮ IF %LogFullCondition% THEN EXEC(CMD('MVS S CLRLOG') ROUTE(ONE AUTO1));
- Substitution is not performed on synonyms found within quotes.
Synonyms found within quotes are treated as literal strings. For example,
consider the SYN statement and automation table entry in Figure 2. Figure 2. Example of Incorrect Synonym Substitution
SYN %LDOMAIN% = '''CNM01'''; ⋮ IF MSGID = 'DSI530I' & DOMAINID ='%LDOMAIN%' THEN EXEC (CMD('CLIST1 ')ROUTE(ONE AUTO1));Although the statement in Figure 2 uses correct syntax, no substitution occurs for the synonym %LDOMAIN% because it is coded within single quotes. If you want single quotes to be included as part of the synonym, code the SYN statement and automation table as shown in Figure 3.
Figure 3. Example of Correctly Using Synonym SubstitutionSYN %LDOMAIN% = '''CNM01'''; ⋮ IF MSGID = 'DSI530I' & DOMAINID = %LDOMAIN% THEN EXEC (CMD('CLIST1 ')ROUTE(ONE AUTO1)); - Consider using a naming convention for synonyms.
