Rexx PDF
Rexx PDF
Rexx PDF
Version 5 Release 2
SC31-8862-01
Tivoli IBM Tivoli NetView for z/OS
®
Version 5 Release 2
SC31-8862-01
Note
Before using this information and the product it supports, read the information in “Notices” on page 183.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 37
Translation Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Command List Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Cross-Domain Information Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Data Set Information Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Global Variable Information Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Message Processing Information Functions . . . . . . . . . . . . . . . . . . . . . . . . . 48
Message Processing Information for All Operating Systems . . . . . . . . . . . . . . . . . . 49
MVS-Specific Message Processing Information . . . . . . . . . . . . . . . . . . . . . . . 55
ROUTCDE Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
REXX Management Services Unit Information Functions . . . . . . . . . . . . . . . . . . . . 62
Hardware Monitor (HMxxxxxx) Examples . . . . . . . . . . . . . . . . . . . . . . . . 71
MSUSEG Syntax and Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
| Probable Cause Syntax and Examples . . . . . . . . . . . . . . . . . . . . . . . . . 76
Operator Information Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Session Information Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
REXX Environment Information Functions . . . . . . . . . . . . . . . . . . . . . . . . . 82
Terminal Information Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Time and Date Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Nulls and Blanks Stripping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Contents v
GLOBALV Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Publications
This section lists publications in the IBM Tivoli NetView for z/OS library and
related documents. It also describes how to access Tivoli publications online and
how to order Tivoli publications.
The following documents are available in the Tivoli NetView for z/OS library:
v Administration Reference, SC31-8854, describes the NetView program definition
statements required for system administration.
v Application Programmer’s Guide, SC31-8855, describes the NetView
program-to-program interface (PPI) and how to use the NetView application
programming interfaces (APIs).
v Automated Operations Network Customization Guide, SC31-8871, describes how to
tailor and extend the automated operations capabilities of the NetView
Automated Operations Network (AON) component, which provides
event-driven network automation.
v Automated Operations Network User’s Guide, GC31-8851, describes how to use the
Automated Operations Network component to improve system and network
efficiency.
v Automation Guide, SC31-8853, describes how to use automated operations to
improve system and network efficiency and operator productivity.
v Command Reference Volume 1, SC31-8857, and Command Reference Volume 2,
SC31-8858, describe the NetView commands, which can be used for network and
system operation and in command lists and command procedures.
v Customization Guide, SC31-8859, describes how to customize the NetView product
and points to sources of related information.
Prerequisite publications
To read about the new functions offered in this release, see the IBM Tivoli NetView
for z/OS Installation: Migration Guide.
Related publications
For more information about REXX, refer to the TSO/E REXX library.
For information about the NetView Bridge function, see Tivoli NetView for OS/390
Bridge Implementation, SC31-8238-03 (available only from the V1R4 library).
You can find additional product information on the NetView for z/OS Web site:
http://www.ibm.com/software/tivoli/products/netview-zos/
http://publib.boulder.ibm.com/tividd/glossary/tivoliglossarymst.htm
The IBM Terminology Web site consolidates the terminology from many IBM
products in one convenient location. You can access the Terminology Web site at
the following Web address:
http://www.ibm.com/ibm/terminology/
For a list of NetView for z/OS terms and definitions, refer to the IBM Terminology
Web site. For brevity and readability, the following terms are used in this
document:
NetView
For the following products:
v Tivoli NetView for z/OS Version 5 Release 2
v Tivoli NetView for z/OS Version 5 Release 1
v Tivoli NetView for OS/390® Version 1 Release 4
v Tivoli NetView for OS/390 Version 1 Release 3
MVS™
For OS/390 or z/OS operating systems
CNMCMD
For CNMCMD and its included members
CNMSTYLE
For CNMSTYLE and its included members
Tivoli Enterprise™ Portal
For CandleNet Portal®
Tivoli Enterprise Portal Server
For CandleNet Portal Server
Unless otherwise indicated, references to programs indicate the latest version and
release of the programs. If only a version is indicated, the reference is to all
releases within that version.
You can use LookAt from the following locations to find IBM message
explanations for z/OS elements and features, z/VM®, VSE/ESA™, and Clusters for
AIX® and Linux®:
v The Internet. You can access IBM message explanations directly from the LookAt
Web site at http://www.ibm.com/eserver/zseries/zos/bkserv/lookat/.
v Your z/OS TSO/E host system. You can install code on your z/OS or z/OS.e
systems to access IBM message explanations, using LookAt from a TSO/E
command line (for example, TSO/E prompt, ISPF, or z/OS UNIX® System
Services running OMVS).
v Your Microsoft® Windows® workstation. You can install code to access IBM
message explanations on the z/OS Collection (SK3T-4269), using LookAt from a
Microsoft Windows DOS command line.
v Your wireless handheld device. You can use the LookAt Mobile Edition with a
handheld device that has wireless access and an Internet browser (for example,
Internet Explorer for Pocket PCs, Blazer, or Eudora for Palm OS, or Opera for
Linux handheld devices). Link to the LookAt Mobile Edition from the LookAt
Web site.
You can obtain code to install LookAt on your host system or Microsoft Windows
workstation from a disk on your z/OS Collection (SK3T-4269), or from the LookAt
Web site (click Download, and select the platform, release, collection, and location
that suit your needs). More information is available in the LOOKAT.ME files
available during the download process.
IBM posts publications for this and all other Tivoli products, as they become
available and whenever they are updated, to the Tivoli software information center
Web site. Access the Tivoli software information center by first going to the Tivoli
software library at the following Web address:
http://www.ibm.com/software/tivoli/library/
Scroll down and click the Product manuals link. In the Tivoli Technical Product
Documents Alphabetical Listing window, click the IBM Tivoli NetView for z/OS
link to access the product library at the Tivoli software information center.
Ordering publications
You can order many Tivoli publications online at the following Web site:
http://www.elink.ibmlink.ibm.com/public/applications/publications/
cgibin/pbi.cgi
Accessibility
Accessibility features help users with a physical disability, such as restricted
mobility or limited vision, to use software products successfully. Standard shortcut
and accelerator keys are used by the product and are documented by the operating
system. Refer to the documentation provided by your operating system for more
information.
For additional information, see the Accessibility appendix in the User’s Guide.
http://www.ibm.com/software/tivoli/education
Support information
If you have a problem with your IBM software, you want to resolve it quickly. IBM
provides the following ways for you to obtain the support you need:
v Searching knowledge bases: You can search across a large collection of known
problems and workarounds, Technotes, and other information.
v Obtaining fixes: You can locate the latest fixes that are already available for your
product.
v Contacting IBM Software Support: If you still cannot solve your problem, and
you need to work with someone from IBM, you can use a variety of ways to
contact IBM Software Support.
For more information about these three ways of resolving problems, see “Support
information” on page 177.
Note: To access a newsgroup, use the instructions appropriate for your browser.
news://news.software.ibm.com/ibm.software.netview
news://news.software.ibm.com/ibm.software.tivoli.business-systems-manager
news://news.software.ibm.com/ibm.software.tivoli.enterprise-console
IBM Tivoli NetView for UNIX and IBM Tivoli NetView for Windows:
news://news.software.ibm.com/ibm.software.tivoli.netview-unix-windows
Downloads
Clients and agents, demonstrations of the NetView product, and several free
NetView applications that you can download are available at the NetView for
z/OS Web site:
http://www.ibm.com/software/tivoli/products/netview-zos/
When using the Windows command line, replace $variable with % variable% for
environment variables and replace each forward slash (/) with a backslash (\) in
directory paths. The names of environment variables are not always the same in
the Windows and UNIX environments. For example, %TEMP% in Windows
environments is equivalent to $TMPDIR in UNIX environments.
Note: If you are using the bash shell on a Windows system, you can use the UNIX
conventions.
Syntax Diagrams
Syntax diagrams start with double arrowheads on the left () and continue along
the main syntax line until they end with two arrowheads facing each other ().
When more than one line is needed for a syntax diagram, the continued lines end
with a single arrowhead ().
Keywords and operands are shown in uppercase letters. Variables are shown in
lowercase letters and are either italicized or, for NetView help and BookManager
online books, shown in a differentiating color. The appearance of syntax elements
indicates the type of element as shown in the following table.
Table 2. Appearance of Syntax Elements
Element Appearance
Keyword CCPLOADF
Variable resname
Operand MEMBER=membername
Default today or INCL
CCPLOADF
CCPLOADF resname
DISPREG
DISPREG
ID=resname
If the default is a keyword, it is shown only above the main line. You can specify
this keyword or allow it to default. Figure 3 on page xv shows the default keyword
STEP above the main line and the rest of the optional keywords below the main
line.
RID
,STEP ,MODNAME=*
RID TASK=opid
,CONTINUE ,MODNAME= *
,END name
,RUN
,OPTION=*
,OPTION= *
HAPIENTR
HAPIEXIT
Syntax Fragments
Commands that contain lengthy sections of syntax or a section that is used more
than once in a command are shown as separate fragments following the main
diagram. The fragment name is shown in mixed case. Figure 4 shows a syntax
diagram with the fragments Pu, PurgeAll, and PurgeBefore.
CSCF
CSCF Pu
PurgeAll
PurgeBefore
Pu
PU=resname
,
,OP=( testop )
PurgeAll
PURGE ALL
PurgeBefore
When an operand can have more than one value, the values are typically enclosed
in parentheses and separated by commas. For example, in Figure 4 on page xv, the
OP operand contains commas to indicate that you can specify multiple values for
the testop variable.
Commas are also used to indicate the absence of a positional operand. In the
following example of the BOSESS command, the second comma indicates that an
optional operand is not being used:
NCCF BOSESS applid,,sessid
You do not need to specify the trailing positional commas. Trailing positional and
non-positional commas either are ignored or cause a command to be rejected.
Restrictions for each command state whether trailing commas cause the command
to be rejected.
Abbreviations
Command and keyword abbreviations are listed in synonym tables after each
command description.
When you type a command list name at a terminal, the commands and
instructions in that command list are interpreted and processed. You can also run
command lists in other ways. For example, you can issue a timer command to run
a command list at a specified time or at time intervals. You can also run more than
one command list at the same time under different tasks. See “Running Command
Lists” on page 5 for more information.
Before you write a command list, analyze your system, network operating
procedures, and the tasks that operators regularly perform. Decide which of these
jobs you want to perform using command lists. Start by writing simple command
lists and add the more complex functions as you gain experience.
Note: This document does not describe how to use NetView operator commands.
If you need information about a specific command, refer to the NetView
online help or the IBM Tivoli NetView for z/OS Command Reference.
Figure 5, written in REXX, establishes terminal access facility (TAF) sessions with
IMS and HCF.
/* STARTUP1 */
’BGNSESS OPCTL,APPLID=IMS1,SRCLU=TAF11,LOGMODE=OPCTLLOG,SESSID=IMS’
’BGNSESS OPCTL,APPLID=HCF1,SRCLU=TAF11,LOGMODE=OPCTLLOG,SESSID=HCFA’
’BGNSESS OPCTL,APPLID=HCF1,SRCLU=TAF12,LOGMODE=OPCTLLOG,SESSID=HCFB’
EXIT
| Instead of having to remember and enter three commands, operators can enter the
| command list name STARTUP1. The command list starts the three sessions and
| operators receive the same messages they would receive if they had entered all
| three commands.
/* NCP1 */
’V NET,ACT,ID=NCP1,LOAD=YES,LOADSTA=LINK1’
EXIT
| The PDS member name is the name you enter to run the command unless you
| define another name for the command list on a CMDSYN keyword on the
| CMDDEF statement. For more information about CMDSYN, refer to the IBM Tivoli
| NetView for z/OS Administration Reference.
The command list name must begin with a nonnumeric character and can be from
one to eight characters. Valid characters are: 0–9 A–Z @ $ #.
After a command list is created and saved as a PDS member, it is ready for the
operator to use.
| Note: To avoid naming conflicts, give your user-written command lists names
| other than the command synonym (CMDSYN) names used for
| NetView-provided command lists. Also, your command list names should
| not begin with any of the 3-character prefixes used by the NetView
| program: AAU, BNH, BNJ, CNM, DSI, DUI, EZL, FLC, FKX, and FKV.
The NetView program supports command lists in data sets that are concatenated
across volumes.
1. Create the data set to be used to store the command lists.
2. Code each command list as a separate member of a command list data set. To
define the name of the command list data set to the NetView startup
procedure, code the JCL DD statement for the DSICLD as follows:
//DSICLD DD DSN=datasetname,DISP=SHR
3. Concatenate data sets by coding the DSICLD statement as shown in Figure 7.
//DSICLD DD DSN=datasetname1,DISP=SHR
// DD DSN=datasetname2,DISP=SHR
// DD DSN=datasetname3,DISP=SHR
// DD DSN=datasetnamen,DISP=SHR
4. Ensure that the first command list data set defined under DSICLD has the
largest block size of any concatenated command list data sets, or that the first
DD statement has a DCB=(BLKSIZE=xxxx) statement, where xxxx is equal to
the largest block size of the concatenated data sets.
Notes:
1. When the NetView program is operating on a z/OS system and you plan to
update or create command lists while the NetView program is running, define
your command list data sets without secondary extents. Otherwise, a command
list might be filed in a new extent.
If this occurs, a secondary extent failure can occur causing error recovery and
loss of a single instance of running the command list. If the error recovery
succeeds and a second attempt to call the command list is made, the command
list is then available.
| If the data set becomes full and you need to compress the data set to add more
| command lists, use the REACC command; for more information, see the IBM
| Tivoli NetView for z/OS Command Reference. You can also call a command list in
| any data set by reading the data set using the pipeline QSAM and saving the
| procedure in memory using INSTORE DSICLD.clistname; for more information,
| see IBM Tivoli NetView for z/OS Programming: Pipes.
2. The block size must be an even multiple of the record length and the record
length must be 80. The records must be formatted as fixed or fixed block at 80.
Ensure that the block size is 3920 or less to reduce paging caused by the block size
exceeding the size of a page of memory.
The method for restricting access to commands is defined in CNMSTYLE and can
be changed dynamically using the NetView REFRESH command.
Generally, commands or command lists that are called from a command list are
also eligible for command authorization. An exception to this rule is when a
command list is called from the automation table, and AUTOSEC=BYPASS is in
effect; refer to the DEFAULTS command in the NetView online help for more
information. Another exception is when a command list is privileged by inclusion
in the DSIAUTB member of DSIPARM and uses the AUTBYPAS function described
in “Command List Information” on page 40.
For more information about how to protect command lists from unauthorized
users, refer to the IBM Tivoli NetView for z/OS Security Reference. For more
information about writing command processors in PL/I or C, refer to the IBM
Tivoli NetView for z/OS Programming: PL/I and C book.
| Note: If you call a command list that has not been preloaded, the command list is
| loaded into main storage, run, and then dropped from main storage.
| Therefore, each time the command list is run, it must be retrieved from the
| auxiliary storage device where it resides. If you preload the command list, it
| can be run multiple times without having to be retrieved from auxiliary
| storage each time.
| The action of MEMSTORE affects all standard means of accessing a member of any
| of the NetView standard DD names. For example, if a REXX procedure has been
| loaded into main storage by MEMSTORE, and you use the BROWSE command to
| view the member, then BROWSE will show the data previously loaded, and you
| will see DATASET: 0 where the concatenation level is listed. Similarly, the LISTA
| DSICLD membname command will show an INSTORE level listing for the member.
| When the procedure is invoked, the member will be ″read″ or copied into another
| location, where it is formatted for interpretation. You can avoid this copying and
| formatting step and obtain a small additional performance enhancement by using
| LOADCL. Use LOADCL only for procedures in DD=DSICLD. After LOADCL, the
| BROWSE command will still show the member as it exists on auxiliary storage.
| However, you can use the LIST CLIST command to review the member as it exists
| in main storage.
Three NetView commands enable you to move command lists into and out of
main storage, and to list command lists that are currently in main storage:
LOADCL
| Works with DROPCL and MAPCL to provide information and control
| about procedures that have been loaded.
DROPCL
Drops a command list that was previously loaded into main storage using
the LOADCL command
MAPCL
Lists command lists that currently reside in main storage
For more information about the LOADCL, DROPCL, or MAPCL commands, refer
to the NetView online help.
Code the name of the command list you want to run in the operator’s profile using
the IC operand of the PROFILE statement, or the IC field in the NETVIEW
segment of the SAF product. For example, if you want to run the HELLO
command list each time an operator logs on, and if the operator has a profile of
PROFBEG, the IC operand can be added to the operator’s profile as follows:
PROFBEG PROFILE IC=HELLO
For more information about the PROFILE definition statement, refer to the IBM
Tivoli NetView for z/OS Administration Reference.
You can include many types of commands in your initialization command list. The
following list describes some of the commands you can include:
v To start autotasks, use AUTOTASK commands. Use START commands to start
other tasks, such as DSTs (data services tasks).
v To restore all task global variables that were saved using the GLOBALV SAVET
command, include:
GLOBALV RESTORET *
Note: The RESTORET depends on two things: the task having previously
performed a SAVET, and the DSISVRT DST being active.
v To set operator-specific defaults that override NetView-wide values set using the
DEFAULTS command, use the OVERRIDE command.
Command lists that the NetView program initiates upon receipt of a message or
MSU can contain a series of commands to perform a function as a result of the
message or MSU. For example, if the message or MSU reported that an NCP failed,
the command list can issue the VTAM command to reactivate the NCP. See
Chapter 5, “Automation Resource Management,” on page 85 for more information.
Note: You can also issue the AFTER, AT, CHRON, and EVERY commands from a
command list.
You can set up the AT, EVERY, CHRON, and AFTER commands so the command
list runs even if the operator is not logged on at the time. This is done with the
PPT operand or by issuing the timer command under an autotask. However, some
commands cannot be used in a command list running under the PPT. See “Primary
POI Task Restrictions” on page 12 for more information.
| You can define command lists so that they always interrupt the processing of other
| command lists. You do this using the TYPE=H (high priority) operand of the
| CMDDEF statement, or by prefixing your command with CMD HIGH. For more
| information about how to code CMDDEF statements, see the IBM Tivoli NetView for
| z/OS Administration Reference. For more information about the CMD command, see
| the online help.
To learn more about the AT, EVERY, CHRON, and AFTER commands, refer to the
NetView online help.
end of the nested command list, it returns control to the calling command list and
proceeds to the next statement, as shown in Figure 8.
EXIT
When planning to create command lists that run other command lists, keep the
following in mind:
v A REXX command list can be called as a REXX command, subroutine, or
function.
v A REXX command list can call a command list written in the NetView command
list language as a command but not as a subroutine or a function.
v A command list written in the NetView command list language can call another
command list written in the NetView command list language or a REXX
command list as a command.
v Command lists written in REXX and command lists written in the NetView
command list language can call each other.
v You can have 250 levels of externally nested command lists.
Only REXX command lists called as commands, external subroutines, or external
functions count as one of the 250 levels of externally nested command lists. You
can call up to 250 REXX command lists as internal subroutines and functions,
but they do not count toward the 250 levels of externally nested command lists.
v You should test each command list before running the command list as part of a
nested chain of command lists.
For information about REXX subroutines and functions, refer to the REXX library.
| In order to pass additional information, you can use pipeline’s SAFE, STEM, or
| VAR stages, or the global variable pool.
| SAFE stage
| NetView messages, or any other data in a pipeline, can be placed into a
| named SAFE stage by either the calling procedure or the called procedure.
| Named SAFE stages endure as long as any member of the nested family is
| still running. Either the calling procedure or the called procedure can add
| to, modify, or delete data from the SAFE. See IBM Tivoli NetView for
| z/OS Programming: Pipes for more information about the SAFE stage
| KEEP stage
| The pipeline KEEP stage is similar to the SAFE stage, and will enable you
| to define a task-global place to store messages. See IBM Tivoli NetView for
| z/OS Programming: Pipes for more information about the KEEP stage.
| STEM stage and VAR stage
| Using pipeline STEM and VAR stages, a called procedure can read from
| and write to the calling procedure’s variables, if those variable names are
| known. A calling procedure written in REXX can control such access using
| REXX’s built-in PROCEDURE and EXPOSE keywords. For example, the
| WINDOW (CNME1505) procedure calls customer-defined subcommands
| from an internal procedure named exterCmd and limits variable access to a
| list named toShow. See CNME1505 and the example subcommand
| CNMEXEC for additional details on using this procedure.
| Global variables
| Procedures can store and modify data in COMMON or TASK global
| variables. The GLOBALV command provides one way to do this in a
| manner similar to using the pipeline VAR and STEM stages. Using the
| COMMON or TASK global variables allows data to be shared with other
| procedures, whether they are called directly or invoked by any other
| means. Be sure to provide a means of verifying the accuracy of any data so
| shared in case any of the procedures involved encounters a failure.
Error Handling
If a nested command list encounters an unrecoverable error, the command list ends
and passes the error back to the command list from which it was called.
Note: A list of return codes can be found at “Return Codes in REXX Command
Lists” on page 30.
If the calling command list is written in REXX, it might be able to take action to
recover from the error passed to it from the nested command list. For information
about coding REXX command lists that can recover from errors, see “Recovering
from Errors in REXX Command Lists” on page 31.
If the calling command list is written in the NetView command list language, and
an error occurs in the nested command list, the calling command list also ends. If
the calling command list was called by another command list, it continues to pass
the error back to the command list from which it was called.
| The commands used within command lists are subject to command authorization,
| unless either SEC=BY was specified on the CMDDEF statement,
| AUTOSEC=BYPASS is in effect, or the command list is privileged by inclusion in
| the DSIAUTB member of DSIPARM and uses the AUTBYPAS function described in
| this manual. For more information, refer to the IBM Tivoli NetView for
| z/OS Administration Reference.
Notes:
1. The NetView RETURN command is not valid in a command list.
| 2. You can use NetView and user-written commands that are defined on the
| CMDDEF statement as regular, high, or both (TYPE=R, TYPE=H, or TYPE=B).
| You can also use command lists that are undefined.
3. You must use the appropriate prefix:
v NLDM for session monitor commands
v NPDA for hardware monitor commands
v STATMON for status monitor commands
The type of long-running command, and whether the command list uses the CMD
command to queue the command, determines whether the long-running command
or the issuing command list receives processing priority. This is described further
in “Queuing Long-Running Commands” on page 11.
To delay the processing of NLDM until your command list is stacked, canceled,
interrupted, or completed, use CMD LOW NLDM.
Refer to the IBM Tivoli NetView for z/OS Customization Guide for more information
about local and global variables, and using the VIEW command with commands
and command lists.
You can then enter the necessary information if the command list is waiting
for an operator response, or ensure that a WAIT or &WAIT is satisfied
before rolling to other components.
You can run command lists under the PPT when the command lists meet any of
the following criteria:
v Routed to the PPT for processing as a result of NetView automation.
v Coded on a CNMSTYLE definition statement to run when the NetView program
is initialized.
v Called with an AT, EVERY, AFTER, or EXCMD command that uses the PPT as
an operand. (PPT on AT, EVERY, and AFTER enables the command to be run
even when the operator who scheduled it is not logged on.)
The following restrictions apply to command lists that run under the PPT:
v In general, you cannot use full-screen commands and immediate commands. Do
not use the following NetView commands:
| – AUTOWRAP
| – BGNSESS
| – INPUT
| – LOGOFF
| – ROUTE
| – SET
| – SUBMIT
v Do not use the following REXX instructions:
– FLUSHQ
– MSGREAD
– PARSE EXTERNAL
– PARSE PULL if there is nothing in the REXX data stack
– PULL if there is nothing in the REXX data stack
– TRAP
– WAIT
v Do not use the following NetView command list language control statements:
– &PAUSE
– &WAIT
| Note: When command lists running under the PPT generate messages containing
| non-Latin characters (such as double-byte characters) that are routed to the
| system console, the messages go to the authorized receiver. If no authorized
| receiver exists, authorized receiver messages should not be generated
Because autotasks have fewer restrictions than the PPT, use them instead of the
PPT whenever possible.
To control the amount of data displayed to the operator during the processing of a
REXX command list, use the NetView PIPE CONSOLE command, TRAP
instruction, or the suppression character (see “Suppressing Display of Non-REXX
Commands” on page 23). Refer to the NetView online help and the REXX library
for information about the TRAP instruction.
To control the amount of data displayed to the operator during the processing of a
command list written in the NetView command list language, use the &CONTROL
statement (see “&CONTROL Statement” on page 104), the &WAIT SUPPRESS
control statement (see “Customizing the &WAIT Statement” on page 135) or the
suppression character (see “Conventions for Suppression Characters” on page 93).
| All of the means of setting a current message that are listed above will return data
| from the current message regardless of how that message was made the current
| message. For a multiline write-to-operator message (MLWTO), only the first line of
| the message is considered by these functions.
| Information about the current message can be retrieved using the REXX functions or
| NetView CLIST variables (refer to “Message Processing Information Functions” on
| page 48), MSU functions (refer to “REXX Management Services Unit Information
| Functions” on page 62), or message information commands (refer to “Commands
| Used in Command Lists” on page 160).
| Notes:
| 1. Usually, the first blank-delimited word from the first line of text is considered
| the message ID. A reply ID, if present, is ignored.
| 2. To test for the existence of a current message, issue this command:
| PIPE SAFE * | COUNT | VAR MSGCOUNT
| Note: For complete information about REXX, refer to the TSO/E REXX library.
As with all non-NetView REXX execs and macros, each NetView REXX command
list or Data REXX file must begin with a comment. REXX comments are marked
with /* at the beginning and */ at the end, and can be used in your REXX
command list wherever necessary.
A REXX command list or Data REXX file consists of a series of clauses, each
having a separate purpose. In a simple REXX command list, the clauses are
interpreted in the sequence in which they are coded. You can control the sequence
in which clauses are run by using specific commands that alter the processing
order.
When an equal sign (=) is the second item in a clause, the clause is identified as an
assignment clause. Assignment clauses enable you to give a value to a variable.
Variables enable you to define different values for the clauses within a command
list.
When the second item in a clause is a colon (:), the clause is interpreted as a label.
Labels identify the target statement for a transfer of control.
The REXX language enables you to call internal or external routines, called
functions. REXX function names must always be followed by parentheses. There
can be up to 10 expressions, separated by commas, between the parentheses. An
expression is something that can be computed. The REXX interpreter performs the
computation named by the function and returns a result. The result is then used in
the expression in place of the function call. To use a function, place the function
name in the command list or Data REXX file at the location where you want the
result to be accessed. There are also several built-in functions included in the REXX
language that perform predefined operations. Refer to the REXX library for a
complete description of the features of the REXX language.
The IBM REXX/370 compiler product must be installed on the system where the
command lists will be compiled.
Refer to the REXX library for directions on how to compile a REXX command list.
For additional performance information about compiled REXX command lists, refer
to the IBM Tivoli NetView for z/OS Tuning Guide.
Notes:
1. You do not need to install or start the compiler on the system where the
NetView program resides.
2. The compiled executable file might be larger (take up more space) than the
original uncompiled command list.
3. The NetView program supports the CEXEC (compiled EXEC) and OBJECT
(object deck) output formats of the REXX/370 compiler.
4. When creating a load module from an object deck, note the following items:
v The object deck must be created and saved from a REXX compiler.
v Two DDNAMEs in the REXXL cataloged procedure are particularly
important:
– The SYSIN DD statement must refer to the object deck (input).
– The SYSLMOD DD statement must refer to the load library specified with
the load module (output).
– The object deck must be link-edited with the EFPL stub to create a load
module, and the load module name cannot conflict with any NetView,
REXX, or other load module name.
| – The REXXL cataloged procedure is used to create a load module; the
| procedure can be found in REXX.V5R2M0.EAGPRC.
– The load module can only be called through or by a REXX CALL
instruction, or as a REXX function.
5. To run CEXEC format compiled REXX command lists, place the output file into
a member of one of the DSICLD data sets.
6. Install the compiler run-time library in an authorized library on the system that
runs the compiled REXX command lists.
| For any NetView application that supports %INCLUDE processing, you can
| substitute a Data REXX program file for the member that the application ordinarily
| reads. The data generated by your program becomes the data delivered to the
| application.
| Note: In this discussion, the term generated data is used to mean data that contains
| REXX variables or function calls that must be evaluated before the data is
| ready to be sent to the receiving application. One example of a receiving
| application is a phase of style sheet processing during NetView
| initialization.
| By definition, Data REXX files are any NetView data files that begin with the Data
| REXX file directives /*%DATA or /*%LOGIC in the first column of the first record.
| The Data REXX file directives determine the format of the Data REXX code that
| follows the directive. These directives provide a convenient way of switching
| between the logic and data formats. The following paragraphs further describe
| these directives.
| Data mode is a convenient way to write large sections of the Data REXX program
| that contain literal data that can be written exactly as the receiving application will
| receive the data. Data that you program dynamically generated in whole or in part
| must be preceded with %> in columns 1 and 2 of the Data REXX program file. For
| example, to create a data record with the domain name of the NetView program
| on which your application is currently running, you might code the following
| starting in column 1:
| %> ’My domain name is’ domain()’.’
| During the first step, each line of the source file is processed individually.
| However, in the second step, REXX interprets the entire Data REXX program
| according to the rules of the REXX language. Thus, REXX elements on one line can
| affect how the following lines are interpreted. For example, consider the following
| Data REXX file:
| 1 /*%DATA Put any comments you want here. */
| 2 %> x = cglobal(’y’); /* getting a value for x
| 3 PASSWORD = XYZ
| 4 %> any comment */
| 5 %> IF tower(’AON’) THEN
| 6 AUTOCMD.mytable.ORDER = C
| During the first step, line 3 is loaded. However, line 3 is never seen during step 3
| because the REXX comment start delimiter, /*, in line 2 matches the REXX
| comment end delimiter, */, in line 4.
| Additional Information
| The following information applies to both data and logic files:
| v Data REXX is supported only in the following:
| – CNMCMD
| – CNMSTYLE
| – DSICNM
| – DSIOPF
| – automation tables
| – code point tables
| – command authorization tables
| – command facility panel-format definition members, such as CNMSCNFT
| – hardware monitor (NPDA) members (but not BNJHEADR)
| – members read using NetView disk services with the INCL option
| – operator profile (DSIPRF) members
| – session monitor (NLDM) members
| – span tables
| – the HELPMAP
| v Data REXX is not supported in VSAM files.
| v REXX clauses that are processed as commands in a normal REXX environment
| are instead passed to the NETVDATA environment. As a result, these clauses are
| seen as data by the application reading the member.
| v Data REXX files should be small because they are read entirely into storage.
| Note that %INCLUDE files that are referenced in a Data REXX file are also read
| into storage if they are Data REXX files; files that are not Data REXX files are not
| read entirely into storage. Therefore, to save storage, do not use Data REXX files
| in %INCLUDE files.
| v Output strings that result from SAY and TRACE instructions are written to the
| network log.
| v The REXX keyword instruction ADDRESS can be used; however, the only
| address that is supported is NETVDATA.
| v The following REXX functions cannot be used in Data REXX files:
| – GETMSG
| – LISTDSI
| – MSG
| – MVSVAR
| – OUTTRAP
| – PROMPT
| – SETLANG
| – STORAGE
| – SYSDSN
| – SYSVAR
| v The following REXX keyword instructions cannot be used in Data REXX files:
| – TRACE ? (interactive trace)
| – PARSE EXTERNAL
| v The PULL and PARSE PULL instructions can be used only to access data from
| the REXX data stack. Do not use PULL and PARSE PULL to pause for operator
| input. Data REXX has no operator input facility.
| v REXX functions invoked from Data REXX using synonym names are not
| supported during NetView initialization CNMSTYLE processing.
| /*%DATA
| The NetView REXX /*%DATA directive specifies data mode for the Data REXX
| code that follows it. The file remains in data mode until either the /*%LOGIC
| directive is encountered or the end of file (EOF) is reached.
| /*%DATA
| /*%DATA comments*/
|
| where:
| /*%DATA
| The /*%DATA directive must begin with the / in column one. A space is
| required after DATA and the word DATA must be in all capital letters. The file
| must begin with either a DATA or LOGIC directive in the first line.
| comments
| Specifies any comments that you want to include. Comments can span
| multiple lines.
| */ Specifies the end of the DATA directive.
| Usage Notes:
| v In data mode, all REXX instructions must be preceded by %> in column one.
| Lines that do not begin with %> are treated as data.
| Example: The following is an example of how to code Data REXX in data mode:
| /*%DATA --- demonstrate data mode */
| Data line (this line has two leading blanks)
| %>IF CGLOBAL(’ABC’) = 1 THEN
| %INCLUDE ABCFILE
| %>ELSE
| %> DO
| %> ’%INCLUDE’ CGLOBAL(XYZfilenameVar)
| Another data line
| %> END
| Final data line
| /*%LOGIC
| The NetView REXX /*%LOGIC directive specifies logic mode for the Data REXX
| code that follows it. The file remains in logic mode until either the /*%DATA
| directive is encountered or the end of file (EOF) is reached.
| /*%LOGIC
| /*%LOGIC comments*/
|
| where:
| /*%LOGIC
| The /*%LOGIC directive must begin with the / in column 1. A space is
| required after LOGIC and the word LOGIC must be in all capital letters. The
| file must begin with either a DATA or LOGIC directive in the first line.
| comments
| Specifies any comments that you want to include. Comments can span
| multiple lines.
| */ Specifies the end of the LOGIC directive.
| Usage Notes:
| v REXX clauses are processed as commands in a normal REXX environment are
| instead passed to the NETVDATA environment. As a result, these clauses are
| seen as data by the application reading the member.
| v In logic mode, REXX instructions must not be preceded by %>.
| Example: The following is an example of how to code Data REXX in logic mode:
| /*%LOGIC --- demonstrate logic mode */
| ’ Data line (this line has two leading blanks)’
| IF CGLOBAL(’ABC’) = 1 THEN
| ’ %INCLUDE ABCFILE’
| ELSE
| DO
| ’%INCLUDE’ CGLOBAL(XYZfilenameVar)
| ’Another data line’
| END
| ’Final data line’
Coding Conventions for REXX Command Lists and Data REXX Files
This section describes the syntax rules that apply when coding REXX command
lists or Data REXX files for the NetView program.
Record Size
| The data portion of records in REXX command lists or Data REXX files for the
| NetView program can be up to 80 characters in length (the records must be a fixed
| length of 80 characters). If the first record of a REXX command list or Data REXX
| file contains numeric characters in columns 73 through 80, the command list or
| Data REXX file is assumed to contain sequence numbers. The NetView program
| will remove the sequence numbers from lines containing executable statements or
| Data REXX control statements. That is, sequence numbers are preserved on lines
| that are known to be data-only (those lines that are contained within a /*%DATA
| section and are not prefixed with %>). The NetView program also truncates
| trailing blanks from all REXX records in REXX command lists and Data REXX files.
| Blank REXX records are not discarded, but are truncated to one blank character.
perform variable substitution on the string. That is, you do not want the REXX
interpreter to interpret the string. When REXX encounters a beginning quotation
mark (single or double) on a command list statement or Data REXX statement, it
stops interpreting until it reaches a matching ending quotation mark.
Do not enclose REXX instructions in quotation marks. REXX recognizes its own
instructions and does not perform variable substitution on REXX instructions. The
following examples show how to use quotation marks to prevent variable
substitution with the REXX SAY instruction:
SAY ’THIS IS A STRING WITH SINGLE QUOTATION MARKS’
SAY "THIS IS A STRING WITH DOUBLE QUOTATION MARKS"
These two instructions display the following at your terminal when using REXX or
writes to the network log when using Data REXX:
THIS IS A STRING WITH SINGLE QUOTATION MARKS
THIS IS A STRING WITH DOUBLE QUOTATION MARKS
In the following example, either of the first two instructions displays the first line
or writes to the network log when using Data REXX. Either of the last two
instructions display the second line:
IT’S EIGHT O’CLOCK. TIME TO BRING UP CICS.
PLEASE ENTER "GO NODENAME" OR "GO STOP"
| Note: NetView commands cannot be issued from Data REXX files. The only
| address environment supported by Data REXX is ADDRESS NETVDATA.
| When REXX clauses are treated as external commands by REXX, they are
| treated as external data by Data REXX.
For example, if you want to use the NetView INACT command in a command list
to deactivate a node named NODE1, code:
’INACT NODE1’
However, if the command list contains a variable named NODE and you want to
deactivate the node whose name is the current value of the NODE variable, code:
’INACT ’ NODE
The next example uses quotation marks to have REXX perform variable
substitution for only part of a command. The example assumes that the DDNAME
has already been allocated. This example first parses the user’s input into a
variable called DDNAME. The TSO/E EXECIO command is then used to read a
line of that DDNAME. ADDRESS MVS is a REXX instruction, so it is not enclosed
in quotation marks. The quotation marks begin before EXECIO because it is a
TSO/E command. The quotation marks end before DDNAME to enable REXX to
substitute the current value of the DDNAME variable into the EXECIO command.
The rest of the EXECIO command is enclosed in quotation marks so that variable
substitution does not take place on the STEM and LINE operands.
ARG DDNAME
ADDRESS MVS ’EXECIO 1 DISKR ’ DDNAME ’ ( STEM LINE’
Notes:
1. Use caution when writing REXX clauses that have quoted strings that span
multiple records. Because the NetView program truncates trailing blanks from
all REXX command list records before running the command list, REXX clauses
that have quoted strings that span multiple records might not run as expected.
For example, in the following set of REXX clauses that span records, The
NetView program removes the blanks in the middle of the quoted string from
the output.
Enter the following:
say ’ABC
DEF’
| When issuing a command that returns its status in the return code, you can
| enhance the performance of your command list by suppressing synchronous
| output from the command. To suppress synchronous output, code the suppression
| character twice. If the suppression character is not known, or it might change, or a
| suppression character is not explicitly defined in CNMSTYLE or its included
| members, use the following general form for suppression:
| SUPPCHAR()||SUPPCHAR()||’SET PF24 IMMED RETRIEVE’
Use the double suppression character when sufficient status is provided by the
return code and to enhance performance of commands that produce line mode
messages synchronously. Using the double suppression character does not affect
output that is scheduled by a command (for example, D NET,APPLS), nor does it
reliably reduce output from a long-running command (for example, NLDM).
| Note: You cannot use this method to communicate with the operator if your
| command list might be used from the NetView management console, from
| the NetView Web application, on an autotask, or for some attended MVS
| console interfaces or might be called remotely by the EXCMD or RMTCMD
| command.
Using the PARSE EXTERNAL or PARSE PULL instructions along with other
instructions, you can code command lists that ask the operator questions and pick
up entered responses. Use the REXX SAY instruction to describe what the operator
should enter. Code the PARSE EXTERNAL or PARSE PULL instruction after the
SAY instruction to temporarily stop the command list (unless, in the case of PARSE
PULL, there is data on the REXX data stack). After the command list has
temporarily stopped, the operator enters the NetView GO command before it
continues. Any data to be passed to the command list is to be entered as an
operand or operands on the GO command. For example, to have the command list
process a YES or NO answer from the operator, code the following SAY and
PARSE EXTERNAL instructions:
SAY ’ENTER "GO YES" OR "GO NO" TO CONTINUE’
PARSE EXTERNAL ANSWER
The operator responds to the command list with either GO YES or GO NO. The
GO command causes the command list to continue processing, and the YES or NO
value is picked up by the PARSE EXTERNAL instruction by placing the value in
the variable ANSWER.
For restrictions on using PARSE EXTERNAL, PARSE PULL, PULL, and TRACE in
Data REXX files, see “Using Data REXX” on page 16.
| When you issue a REXX SAY instruction in a REXX command list for the NetView
| program, a header precedes the data displayed on the operator’s screen. The
| header is defined by the screen format member in effect and, by default, is 12
| characters in length.
For Data REXX files, output strings that result from the SAY and TRACE
instructions are written to the network log.
Do not use MSGID() as the first item of output from a SAY instruction because the
text of the SAY instruction is processed as a regular NetView message. This
processing can cause the message to be trapped by a TRAP instruction and can
incorrectly satisfy a WAIT instruction, or cause automation processing to loop.
| Be careful when you use the CALL instruction to call a REXX command list from
| another REXX command list. The command list you call is treated like a
| subroutine, and some data is shared between the initial command list and the
| called command list. For example, trapped message queues, values of NetView
| commands (such as GETMLINE), and the values of message processing REXX
| functions (such as MSGID) are shared between the two command lists. To prevent
| this sharing of data, call the routine as a NetView command rather than using the
| CALL instruction. Note that this options is not available in Data REXX.
Some REXX functions return different values depending on the operating system
under which the command list containing the functions runs. For example, DATE()
returns the current date in different formats depending on the operating system.
The REXX LINESIZE() function always returns the value 32 728 when used in
REXX command lists or Data REXX files for NetView.
For restrictions on using REXX functions in Data REXX files, see “Using Data
REXX” on page 16.
Note: The REXX STORAGE() function cannot be used in Data REXX files.
Link-edit the real directory and function code into load module DSIRXUFP for a
user function package or into DSIRXLFP for a local function package. As part of
coding the interface to your function code, use the NetView DSIRXEBS macro to
obtain a new EVALBLOCK.
Refer to the REXX library for instructions on coding a real directory and coding
the interface to your function code.
Refer to IBM Tivoli NetView for z/OS Programming: Assembler for information about
the DSIRXEBS macro and function packages, and about writing function package
directories.
Refer to IBM Tivoli NetView for z/OS Installation: Configuring Additional Components
and the IBM Tivoli NetView for z/OS Tuning Guide for information about improving
the performance of REXX function packages for the NetView program.
Notes:
1. The only valid addressing environments recognized in a NetView REXX
command list are NETVIEW, NETVASIS, and those supported by TSO/E REXX
in any MVS address space.
2. Programs such as SDSF that do program calls will abend if they are linked or
attached. For example, the NetView status monitor and the subsystem router
are examples of programs that can perform program calls. NetView cannot link
or attach to any such program that can perform program calls.
3. The NetView program does not support a TSO/E environment in the NetView
address space.
4. The NetView program returns an error if you try to run a command that is
routed to an incorrect addressing environment.
5. The ADDRESS command only supports address environment NETVDATA
when issued from Data REXX files.
Coding the chain this way enables you to use SIGNAL ON HALT to try to recover
if EXECIO with the FINIS option encounters an error closing a file. If the EXECIO
command encounters an error, it sets the RC variable to a nonzero return code.
Refer to the REXX library for information about return codes used by the EXECIO
command.
If you use EXECIO to read or write a member of a partitioned data set (PDS) and
are not sure whether the member exists, use the NetView REXX FNDMBR(...)
function to determine the members existence before issuing the EXECIO command.
See “PRINT Example” on page 172 and “TYPE Example” on page 174 for examples
of how EXECIO can be used in a REXX command list.
These commands closely resemble the TSO/E commands for allocating and
deallocating data sets. However, because these commands are provided by the
NetView program, you do not need to use the ADDRESS MVS instruction when
using these commands in a command list. Simply enclose the commands in
quotation marks as you do for other NetView commands. The TYPE, TYPEIT, and
PRINT examples in Appendix G, “Examples of REXX Command Lists for
NetView,” on page 163 use the NetView ALLOCATE command.
Refer to the NetView online help for the syntax of the ALLOCATE and FREE
commands.
| Note: When REXX clauses are treated as external commands by REXX, they are
| treated as external data by Data REXX.
Before running REXX command lists, consider how many concurrent REXX
command lists are usually active for any given NetView task. NetView retains up
to 10 REXX environments and their associated storage until you log off, unless you
use the DEFAULTS or OVERRIDE command to change the number of REXX
environments retained. Refer to the NetView online help for additional information
about the DEFAULTS and OVERRIDE commands.
You can reduce the number of REXX environments the NetView program retains,
to minimize the storage each task using REXX requires. However, if you set this
number to zero, the NetView program does not save any REXX environments and
the initialization performance of every REXX command list is affected.
Consider the storage required to initialize a REXX environment before running any
REXX command lists. By default, REXX gets sufficient storage for a REXX
command list with about six levels of nested calls. You can change the acquired
storage amount with the DEFAULTS or OVERRIDE command.
REXX command lists that use large numbers of REXX variables or that nest more
than six levels cause the storage to increase as needed. Each REXX command list
requires approximately 12K of storage to start. If you set the amount of
initialization storage to zero, storage is acquired as needed, but performance is
degraded for the first REXX command list using this REXX environment.
Notes:
1. Two entries in the REXX IRXANCHR table are required for each non-nested
NetView or REXX command list to run. If a REXX command list is called from
another REXX command list, a new environment is not required. The nested
command list uses the environment of the primary command list.
2. A recommended default number of REXX environments slots in IRXANCHR
for the NetView program is twice the maximum number of command lists that
can be scheduled to run concurrently under all active NetView tasks, plus one
for Data REXX for each active NetView task.
The number of unique REXX environments that can be created at one time is
limited by MVS. Therefore, your nested chains are also limited in the number of
REXX command lists that can be called by the assembler, C, or PL/I command
processors.
Refer to the REXX library for information about the maximum number of
environments in an address space.
When you use PARSEL2R in a REXX command list, enclose the command in
quotation marks to avoid variable substitution. For example:
TITLE = ’PROCEDURE/ACTION NOT SUPPORTED: X'’087D’'’
’PARSEL2R TITLE A1 A2 A3 A4 A5 A6 A7 A8’
Refer to the NetView online help for information about the PIPE EDIT and
PARSEL2R commands. Refer to the REXX library for information about the REXX
PARSE instruction.
TS
TS
enter GO TRACE OFF to end the trace, or enter GO to continue tracing. Also, after
receiving one of the messages indicating a trace point is reached, you can enter GO
followed by a command or instruction you want to run at a given point in the
command list. For example, to set a variable to a certain value at that point in the
command list, you can enter:
GO X=5
If you enter a TS command but decide before the trace begins that you do not
want to run the trace, use the TRACE END (TE) command to cancel the trace. You
can also use the TE command to end a trace that is not interactive.
TE
TE
For more information about TS and TE, refer to the NetView online help.
See “Recovering from Errors in REXX Command Lists” for more information about
using the SIGNAL instruction with the NetView program.
If an error occurs, the SIGNAL instruction passes control to another part of the
command list. Depending on the error condition, the SIGNAL instruction can pass
control to three different labels in the command list. These labels are as follows:
v SIGNAL ON FAILURE passes control to a label named FAILURE when the error
condition results in a negative return code. The only negative return codes
returned by the NetView program are –1 and –3. However, if your command list
calls user-written commands, control is passed to FAILURE when any negative
return code, except –5, is returned.
If your command list recovers from the error, you can return the appropriate
return code to the calling command list. If your command list does not recover
from the error, pass the failure to the calling command list with EXIT –1.
v SIGNAL ON ERROR passes control to a label named ERROR when any
command or function in your command list returns a positive return code.
Control is also passed to ERROR when you do not code SIGNAL ON FAILURE
and a command or function returns any negative return code except –5.
The return code you pass to any command list that nested your command list
should reflect the severity of the error. A zero (0) return code is recognized by all
NetView commands as an indication of successful completion, while all positive
return codes indicate that an error occurred.
v SIGNAL ON HALT passes control to a label named HALT when the command
list is canceled. A command list is canceled when:
– A RESET NORMAL command is run on the current operator task while your
command list is running.
– A CLOSE IMMED command is run on any task in your NetView program
while your command list is running. The command list continues processing
as long as it does not issue NetView commands.
– During SNA sessions, an operator presses the Attn key while your command
list is running.
– A command issued by your command list is canceled or returns a return code
of –5.
– The operator’s terminal session is lost for any reason, including the operator
entering the LOGOFF command, while the command list is running.
To pass the HALT condition to any command list that nested your command list,
end the command list with EXIT –5.
Notes:
1. If you do not code SIGNAL ON HALT, the NetView program passes the halt
condition to the command list that nested your command list.
2. Whenever you call another REXX command list as a function or subroutine, the
following statement of the command list tests the RESULT variable for the –5
cancel condition.
3. If you code SIGNAL ON FAILURE, the NetView program passes only the halt
condition to the calling command list if you code EXIT –1.
For more information about the SIGNAL instruction, refer to the REXX library.
Pipelines, called with the PIPE command, provide both extended function and
reduced complexity for the automation of message handling. The PIPE command
is therefore a recommended alternative to the TRAP and WAIT instructions.
For information about NetView pipelines, refer to IBM Tivoli NetView for
z/OS Programming: Pipes.
For more information about REXX syntax rules and information about other REXX
instructions, refer to the REXX library.
TRAP, WAIT, and MSGREAD monitor the operator station task (OST) for specific
messages or wait for a specified period of time.
Use the TRAP command to define the messages for which the command list
should wait. When a TRAP instruction is issued, NetView begins monitoring the
operator task for an occurrence of a specified message. If the message is received,
it is stored in a message queue.
When a WAIT command is issued, the command list stops processing until one or
more of the messages specified on the TRAP instruction are received or until the
specified period of time elapses. When a WAIT instruction completes, the value
returned by the EVENT() function will indicate the reason that the WAIT
instruction completed.
If the operator task receives any of the messages specified on a TRAP instruction,
you can use the MSGREAD instruction to read the trapped messages from the
message queue. The command list can then take action based on the content of
each message.
The FLUSHQ instruction is used to remove all trapped messages from the message
queue.
The GLOBALV command defines, gets, puts, saves, restores, and purges tasks and
common global variables in REXX command lists.
Refer to the NetView online help for more information about these REXX
instructions and their syntax.
If you used the REXX CALL instruction to call the nested command list, trapped
messages that have not been removed using MSGREAD remain available because
the trap message queue is shared with the nested command list. However, if you
called the nested command list without using the CALL instruction, the trapped
messages are available only to the command list that issued the TRAP instruction.
Note: If a nested command list ends before trapped messages return and these
same messages were being trapped by the calling command list, the
messages are available to the calling command list and are placed in the
message queue. It is possible, therefore, for the message queue to grow large
enough for the NetView program to run out of storage.
| 2. If the command list starts VIEW, you do not need to use the WAIT instruction
| to wait for messages or to wait for operator input. For more information on
| VIEW, refer to the IBM Tivoli NetView for z/OS Customization Guide.
The following considerations apply when using WAIT with nested command lists:
v Messages that arrive for the waiting command list are queued until the nested
command list finishes processing.
v If you specify the same message number on TRAP instructions in both the
waiting and nested command lists, the message satisfies the WAIT in the nested
command list.
v If you used the REXX CALL instruction to call the nested command list, trapped
messages that have not been removed using MSGREAD remain available
because the trap message queue is shared with the nested command list.
However, if you called the nested command list without using the CALL
instruction, the trapped messages are available only to the command list that
issued the TRAP instruction.
For example, if MSGREAD is used to read the following message from domain
DOM01:
DSI008I SPAN1 NOT ACTIVE
For more information about these and other message processing functions, see
“Message Processing Information Functions” on page 48 and “MVS-Specific
Message Processing Information” on page 55.
Notes:
1. Before a MSGREAD instruction is issued, the values of MSGID(),
MSGORIGN(), and MSGSTR() are null. The value of MSGCNT() is 0. The
MSGVAR(n) functions retain any values they are given when the command list
is run.
2. If you issue a MSGREAD instruction when the message queue is empty, the
values of MSGID(), MSGORIGN(), MSGSTR(), and MSGVAR(n) are set to null.
The value of MSGCNT() is zero.
3. If MSGREAD reads a multiline message, the functions are set according to the
first line of the message. Refer to the GETM commands in the NetView online
help or the IBM Tivoli NetView for z/OS Command Reference for information
concerning working with multiline messages.
4. The MSGVAR(1)–MSGVAR(31) functions can be given values when a command
list is called in the same way as the &1–&31 NetView command list language
parameter variables. If MSGVAR(1)–MSGVAR(31) are given values when the
command list is called, save those values in variables before issuing a
MSGREAD instruction. This lets you use the values that are modified by
MSGREAD.
5. After using MSGREAD, save the values of the message functions in variables
before issuing another MSGREAD instruction.
You can improve the performance of your REXX command list by limiting the use
of REXX functions provided by the NetView program. If the same function,
provided by NetView, is used several times in the command list without a change
in value, use the function once to set a local variable to the function’s returned
value. You can then use the local variable in place of the function. If the value
returned by the function might change during processing of the command list, you
need to use the function each time (instead of the local variable) to access its
current value.
The functions provided by the NetView program return values based on system
information. To use a function, you must place the function name in the REXX
command list at the location where you want the information to be accessed.
When the command list runs, the NetView program returns the current value of
the function’s related system information.
The functions let you obtain information about the operating environment, test
conditions in a command list, and take actions based on the results.
Note: For more information about REXX syntax rules and other REXX functions,
refer to the REXX library.
The tables in this chapter show the tasks performed by each NetView REXX
function and equivalent NetView command list language control variable used in
NetView command lists. The tables are listed by NetView functions. REXX
functions and equivalent NetView command list language control variables are in
alphabetical order, with the REXX function shown first.
In the tables, the function and control variable are followed by the description.
Notes:
1. Where both a NetView command list language control variable and a REXX
function exists for a task, descriptions are given generically without the NetView
command list language ampersand prefix or the REXX open/close parentheses
suffix.
2. Where NetView command list language control variables and REXX versions of
a function differ operationally, descriptions for each are given separately; the
NetView command list language control variable description contains only the
differences between the two versions.
3. REXX functions provided for use by the NetView program can be used only
with the NetView program. These functions are not supported by the REXX
interpreter and cannot be used in REXX execs run in a non-NetView
environment.
4. Not all NetView REXX functions can used in Data REXX files. See the function
description to determine if a function can be used in a Data REXX file.
5. REXX functions listed in Table 8 on page 49, Table 9 on page 55, and Table 10
on page 63 return a value consistent with no message to process when used in
Data REXX files.
Translation Functions
Table 3. Translation Functions
Function or Variable Description
CODE2TXT(table,code) Provides translation for various types of code points to national language text.
You can use the NetView program with a problem management database to open
problem records when NetView alerts are received. The code point translation function
is provided in REXX to translate the numeric code points received in the alert into
readable text.
CODE2TXT
CODE2TXT(table,code)
The example translates code point 362B in the SNAALERT table to “TRANSMITTER
FAILURE”.
Error Processing: Error conditions encountered by this function are handled as follows:
v Non-valid operand: If a non-valid operand (such as a non-valid table name) is
detected, the NetView program issues message CNM432I (non-valid operand). A
REXX syntax condition flag is raised and the REXX interpreter then generates a
message.
v Non-valid code syntax: If a non-valid syntax is detected, the NetView program
issues message CNM423I (non-valid syntax). A REXX syntax condition flag is raised
and the REXX interpreter generates a message.
v Too many operands: Extraneous operands are ignored.
v Code point not found in table: A null string is returned, but no flag is raised.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 39
Translation
| SUBSYM
| SUBSYM(symbolic)
| where:
| symbolic
| Specifies the name of the MVS system symbolic.
| An example using SUBSYM to find out the name of the &DOMAIN follows:
| SUBSYM(’&DOMAIN’)
AUTHCHK ( keyword=value )
keyword
where:
keyword
Specifies the keyword to be authority checked. Each keyword can contain a
maximum of 8 characters. A maximum of twenty keywords with optional values
can be passed to the program. Because variable substitution can yield a null
keyword, AUTHCHK can accept a null keyword. For example, AUTHCHK() is a
valid call of the AUTHCHK function. When a null keyword is passed to the
AUTHCHK function, authority is assumed to be granted for that particular
keyword.
value
Specifies a value for the keyword. Each value can contain a maximum of 8
characters. You cannot specify value without keyword=.
Because variable substitution can yield a null value, AUTHCHK can accept a null
value and strip the ‘=’ sign to yield a ‘keyword only’ security check. For example,
after variable substitution, this is a valid call of the AUTHCHK function:
AUTHCHK(keyword1=,keyword2=value2,keyword3,keyword4=value4)
Keywords and keyword=value combinations must be separated by commas.
Usage notes:
1. If the keyword and value are both null, the null string is returned, which
implies that authority is granted.
2. keyword=value can be any of the following:
v The value of a single variable.
v Two variables with ‘=’ in between. The = sign must be enclosed in single
quotation marks.
v Two literal strings with ‘=’ in between. The = sign must be enclosed in
single quotation marks.
v A literal and a variable with ‘=’ in between. The = sign must be enclosed in
single quotation marks.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 41
Command List Information
In this example, if either of the parameters passed in the variables P1 and P2 does not
pass authority checking, a non-null value is returned by AUTHCHK. If a keyword
fails, it is included in a message and the REXX program ends. If a value fails, the
keyword and value are included in a message and the REXX program ends. For
example, if OPER1 enters NVRXCMD START,LU=LU200, but is not authorized to use the
START keyword, OPER1 IS NOT AUTHORIZED TO KEYWORD/VALUE START is displayed and
NVRXCMD ends. If OPER1 enters NVRXCMD START,LU=LU202, but is not authorized to
use the value LU202, OPER1 IS NOT AUTHORIZED TO KEYWORD/VALUE LU=LU202 is
displayed and NVRXCMD ends.
For information about keyword security, refer to the RACF library and the IBM Tivoli
NetView for z/OS Administration Reference.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 43
Command List Information
For Data REXX, this function returns the member name of the file that is being
processed.
On the &EXIT statement, you can set the return code to 0, −1, or a positive integer.
The NetView program can set the return code to 0, −1, −2, −3 or −5. You cannot code
−2 or −3 on the &EXIT statement, but you can test for them. All other negative return
codes are reserved.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 45
Cross Domain and Global Variable
For more information about the DOMAINS and RRD statements, refer to the IBM
Tivoli NetView for z/OS Administration Reference.
The value of n is either a number or a variable with a numeric value. The maximum
value of n is the value of NVCNT.
Notes:
1. If you specify a value that is not valid in n for:
v NVID, a null value is returned
v &NCCFID, an error message is returned
2. To obtain the local domain identifier, use the APPLID function. APPLID returns the
local domain ID appended with a 3-character alphanumeric value assigned by the
NetView program.
NVSTAT(name) Indicates whether you have an active session with a domain. The value of name is the
domain identifier of the domain you are querying. If you have an active session with
&NCCFSTAT name the domain, NVSTAT(name) or &NCCFSTAT return a value of ACT. If you do not have
an active session with the domain, INACT is returned.
Note: If you specify no name or a name that is not valid for:
v NVSTAT, a null is returned.
v &NCCFSTAT, an error message is returned.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 47
Data Set Information Functions
Returns the value of the named common global variable if it exists. If no common
global variable with the specified name exists, a null value is returned. If you do not
specify name, or if you specify more than one name, a syntax error occurs.
End of REXX
TGLOBAL(name)
REXX
Returns the value of the named task global variable if it exists. If no task global
variable with the specified name exists, a null value is returned. If you do not specify
name or specify more than one name, a syntax error occurs.
End of REXX
Table 9 on page 55 lists only those functions and variables that are available for use
solely for messages originating from MVS systems.
In all cases, the value of the NetView command list language control variable and
REXX function is null unless otherwise stated if no message processing information
is available.
Some of the functions and variables that are listed in this section contain
discussion of a current message. “Working with Messages” on page 14 contains
additional information about current message.
&ACTIONMG
ATTNID() Returns the VSE attention identifier ID. A plus sign (+) indicates that a reply is
required for this message immediately. A minus sign (−) indicates that a reply is
&ATTNID required for this message.
This function has a value if the message is from a VSE system, but null for non-VSE
messages.
EVENT() The NetView event that satisfied the WAIT is determined by the value of the REXX
EVENT() function. The REXX command list can use the EVENT() function to set a
variable and take appropriate action based on the set value. The possible returned
values from EVENT() are as follows:
M The message for which the command list is waiting has arrived. The message
can be read using the MSGREAD instruction.
T The time period for which the command list was waiting has expired, and
processing is resumed.
G You entered the GO command, and processing is resumed.
E You did not code the WAIT or TRAP instructions correctly. For example, you
entered the operands in the incorrect order or issued a WAIT for messages
instruction without a matching TRAP instruction. The command list resumes
processing.
If you do not issue a WAIT instruction in a command list, the value of the EVENT()
function is replaced with a value of null.
HDRMTYPE() Specifies the 1-character NetView buffer type of the received message or MSU. Buffer
types are described in IBM Tivoli NetView for z/OS Programming: Assembler.
&HDRMTYPE
IFRAUGMT() Returns the Greenwich mean time when the automation internal function request
(AIFR) was created. IFRAUGMT is returned as an 8-byte hexadecimal value in store
&IFRAUGMT clock format.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 49
Message Processing
01 = Low priority
10 = High priority
11 = Test the receiver for priority
3 VM PMX
IFRAUI3X() Returns a 32-byte string of ’1’ and 0’ values corresponding to control flags in the
IFRAUI3X word of the DSIIFR. The first 8 bits are the same as IFRAUIN3, allowing all
&IFRAUI3X 32 bits to be accessed at once.
IFRAUSB2() Returns a 2-byte user field in DSIIFR as a string of 2 characters.
&IFRAUSB2 Notes:
1. This function is null if the field is all blanks or binary zeros in any combination.
2. IFRAUSB2 and IFRAUSRB refer to the same user field, but return the value in
different formats.
IFRAUSC2() Returns a 16-byte user field in DSIIFR as a series of 128 on (1) and off (0) EBCDIC
characters representing the bits in order.
&IFRAUSC2 Note: IFRAUSC2 and IFRAUSRC refer to the same user field, but return the value in
different formats.
IFRAUSDR() Returns the 1–8 character name of the originating NetView task.
&IFRAUSDR
IFRAUSRB() Returns a 2-byte user field in DSIIFR as a series of 16 on (1) and off (0) EBCDIC
characters representing the bits in order.
&IFRAUSRB Note: IFRAUSRB and IFRAUSB2 refer to the same user field, but return the value in
different formats.
&IFRAUSRC Notes:
1. This function is null if the field is all blanks or binary zeros in any combination.
2. IFRAUSRC and IFRAUSC2 refer to the same user field, but return the value in
different formats.
IFRAUTA1() Returns 6-bytes of indicator bits as a series of 48 on (1) and off (0) EBCDIC characters
representing the bits in order. IFRAUTA1 enables checking of control information. The
&IFRAUTA1 bit positions are:
1, 2, 25 HOLD action.
5, 6, 26 SYSLOG action.
7, 8, 27 NETLOG action.
9, 10, 28 HCYLOG action.
11, 12, 29 DISPLAY action.
13, 14, 30 BEEP action.
20 Message from MVS.
23 VSE format message.
24 Action message.
47 Automation vector extensions exist.
48 Presentation vectors exist in data buffers.
Notes:
1. Other bits can be tested but have no recommended use.
2. Refer to the description of DSIIFR fields IFRAUTA1 through IFRAUTA6 in IBM
Tivoli NetView for z/OS Programming: Assembler.
IFRAUWF1() Returns 4-byte MVS-specific WTO information as a series of 32 on (1) and off (0)
EBCDIC characters representing the bits in order. Specific bit positions with
&IFRAUWF1 recommended uses are:
6 Message is a WTOR.
7 Message is suppressed.
8 Broadcast to all.
9 Display JOBNAMES.
10 Display STATUS.
14 DISPLAY SESSION.
Note: Other bits can be tested but have no recommended use. MLWTO flags in this
area also have no recommended use. MLWTO indicators are moved into the data
buffers.
LINETYPE() Returns the multiline write-to-operator (MLWTO) line type or MSU data buffer type,
as follows:
&LINETYPE C Message control line.
L Message label line.
D Message data line.
DE Last message data line.
E The line is the last message line and contains no data.
H The line is the HIER data buffer type.
M The line is the MSU data buffer type.
blank The message is a single-line message.
null There is no message or MSU data buffer associated with this command list.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 51
Message Processing
End of REXX
The difference from REXX is that &MSGID is used in NetView automation, with
&WAIT, and with the LINKPD command.
MSGITEM(n)
REXX
&MSGITEM
Returns an item from the current message (“Working with Messages” on page 14
contains additional information about current message.) The first blank-delimited string
after a reply id (if there is one) is considered the message ID, as well as item 0. After
the message ID, parsing for items 1 through MSGCNT() is performed as follows:
v Strings can be delimited by either blanks or commas.
v A string beginning with a single quote preceded by a blank or comma, and ending
with a single quote followed by a blank or comma, is considered a quoted string,
and is treated as a single item, which does not include the surrounding quote.
v Every other delimited string that is not in a quoted string is treated as a single item.
v Delimiters that are not within quoted strings are not part of any item.
MSGITEM can return strings longer than 255.
End of REXX
Refer to the NetView online help for more information about using functions with
MSGREAD.
End of REXX
Specifies the domain where the message originated. &MSGORIGIN is used in NetView
automation, with &WAIT, and with the LINKPD command.
See “Control and Parameter Variables Used with &WAIT” on page 133 for more
information about using control variables with &WAIT.
See “LINKPD Results” on page 151 for more information about the LINKPD
command.
End of REXX
Is the message text of the message most recently received by NetView. &MSGSTR does
not include the message identifier (the token used by the &MSGID control variable).
&MSGSTR is used with &WAIT and with the LINKPD command.
See “Control and Parameter Variables Used with &WAIT” on page 133 for more
information about using control variables with &WAIT.
See “LINKPD Results” on page 151 for more information about the LINKPD
command.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 53
Message Processing
Returns the text of a message. The NetView program changes the values of the
MSGVAR(1) through MSGVAR(31) functions to reflect the text of the message.
Note: MSGVAR(1) through MSGVAR(31) are equivalent to the NetView command list
language variables &1–&31.
Each MSGVAR(n) function is set to a token of the last message read by MSGREAD.
MSGVAR(1) is set to the token following the message identifier—the token used by the
MSGID() function. MSGVAR(2) is set to the next token to the right of MSGVAR(1), and
so on, up to a maximum of 31 variables. MSGVAR(n) is used for NetView automation,
with MSGREAD, and with the LINKPD command.
Refer to the NetView online help for more information about using functions with
MSGREAD.
See “LINKPD Results” on page 151 for more information about the LINKPD
command.
The MSGVAR(n) functions can be given values when a command list is called in the
same way as are the &1–&31 NetView command list language parameter variables.
MVSRTAIN() In the automation table, a 3-bit field describing MVS retain characteristics of the
message.
&MVSRTAIN Note: The 3 flags correspond to 3 flags defined in the MVS WQE control block when
NetView is using the SSI interface, and corresponds to 3 similar flags in the MDB
when running in Extended Console Mode. The exact meaning and use of the flags is a
property of the operating system.
&MVSRTAIN in NetView command list language is a 3-bit field describing MVS retain
characteristics of the message.
NVDELID() Returns the 24-character NetView deletion identifier for a message. You can remove
the message from the held queue for all tasks in the NetView program using the
&NVDELID NetView DOM NVDELID command. This is the NetView equivalent of the MVS DOM
function, but is used for messages that are not MVS WTOs or WTORs.
REPLYID() Returns the reply identifier for WTORs. This field has a maximum length of 8
characters.
&REPLYID
For messages from VSE systems, the REPLYID is the last three characters of the
6-character message prefix. The three returned characters are the message reply ID
only if the sending system uses those characters to designate a reply ID for a message.
SESSID() Returns the 1–8 character ID of the TAF (terminal access facility) session that sent the
message.
&SESSID
See Chapter 5, “Automation Resource Management,” on page 85 for more information
about NetView automation.
Note: If TAF session is started with a SESSID equal to the domain ID, SESSID is set
| unpredictably and might give unpredictable results. If the current message originated
| from a PPI receiver pipe stage, SESSID shows the SAF ID.
Some of these message information functions and control variables return valid
meaningful values only if the message currently being processed was originally a
message data block (MDB). Where applicable, this is noted in Table 9.
Table 9. MVS-Specific Message Processing Information
Function or Variable Description
AREAID() Returns a 1-letter (A-Z) identifier for the area on the multiple console support console
panel that displays the message.
&AREAID
AUTOTOKE() Returns the 1–8 character name of the MVS message processing facility (MPF)
automation token.
&AUTOTOKE Note: If you’ve specified AUTO(YES) or AUTO(NO) in the MPF table, the values YES and
NO are not automation tokens.
CART() Returns the 8-byte MVS command and response token (CART). The CART might
contain non-displayable characters.
&CART
Notes:
1. This function has a value only if the message currently being processed was
originally a message data block (MDB).
2. CART is available on systems running MVS 4.1 or a later release.
DESC() Returns the MVS DESCriptor codes as a series of 16 on (1) and off (0) EBCDIC
characters representing the bits in order. Refer to the MVS library for information
&DESC about code values.
JOBNAME() Returns the 1–8 character MVS job name identifier. Because JOBNAME is the name of
the job that originated the message, it might not always be the same as the name of
&JOBNAME the job to which the message is referring. For example, the job names might be
different when MVS issues a message about the NetView job. Also, JOBNAME can
contain the name of an initiator (instead of the actual job name) when a job is started
or stopped. If the message is issued during startup or stopping, extract the job name
from the message text rather than using the JOBNAME function.
Note: The same information is available using MSGCOJBN; refer to the information
about MSGCOJBN on page 57.
JOBNUM() Returns the 8-character MVS job number identifier.
Note: The MVS job identifier might contain embedded blanks.
&JOBNUM
KEY() Returns the 8-character retrieval key associated with the message.
Note: This function has a value only if the message currently being processed was
&KEY originally an MDB.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 55
Message Processing
End of REXX
See “Control and Parameter Variables Used with &WAIT” on page 133 for more
information about using control variables with &WAIT.
MSGCOJBN() Returns the 1–8 character originating job name. (The same information is available
using JOBNAME, described on page 55.)
&MSGCOJBN Note: This function has a value only if the message currently being processed was
originally a message data block (MDB).
MSGCPROD() Returns the 16-character MVS product level. The characters are defined as follows:
v The first 4 characters represent an MVS control point object version level.
&MSGCPROD v The next 4 characters represent the control program name (MVS).
v The last 8 characters represent the function modification identifier (FMID) of the
originating system.
Note: This function has a value only if the message currently being processed was
originally an MDB.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 57
Message Processing
REXX
Note: This function has a value only if the message currently being processed was
originally an MDB.
MSGGDATE() Returns the message date in a 7-character format of yyyyddd, where yyyy is the year
and ddd indicates a calendar day.
&MSGGDATE
Notes:
1. This is not necessarily the current date. It might be the date with which MVS
associates the message as having been issued.
2. This function has a value only if the message currently being processed was
originally an MDB.
REXX
End of REXX
Note: This function has a value only if the message currently being processed was
originally an MDB.
MSGGMFLG() Returns the 16-bit MVS general message flags. Bit positions and their meaning are:
1 DOM (delete operator message)
&MSGGMFLG Note: This function has a value only if the message currently being processed was
originally an MDB.
MSGGMID() Returns the 4-character hexadecimal value MVS message identifier field.
&MSGGMID Notes:
1. This function has a value only if the message currently being processed was
originally an MDB.
2. MSGGMID represents the same information as SMSGID, except that SMSGID
returns a decimal value instead of a hexadecimal value.
MSGGSEQ() Returns the 1- to 8-character numerical decimal sequence number. This function
represents the last three bytes of MSGGMID.
&MSGGSEQ Note: This function has a value only if the message currently being processed was
originally an MDB.
MSGGSYID() Returns the 1- to 3-character numerical decimal system identification. This is the first
byte of MSGGMID.
&MSGGSYID Note: This function has a value only if the message currently being processed was
originally an MDB.
MSGGTIME() Returns an 11-character (including periods) time in the form hh.mm.ss.th, where hh is
the hours, mm is the minutes, ss is the seconds, and th is tenths and hundredths of
&MSGGTIME seconds.
Note: This function has a value only if the message currently being processed was
originally an MDB.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 59
Message Processing
For more information about DSIMMDBS, refer to IBM Tivoli NetView for
z/OS Programming: Assembler. For more information about CNMPMDB, refer to IBM
Tivoli NetView for z/OS Programming: PL/I and C.
The source name is selected from the source object by the following rules:
v The first nickname, if any
v The first network identifier concatenated to a network addressable unit (NAU)
name, with a period (.) between, if both exist in sequence
v The first NAU name, if it exists
v The string “N/A” if none of the other names in this list are specified in the source
object
v Null, if there is no source object
For more information about how the source object is defined, refer to the DSIAIFRO
mapping in IBM Tivoli NetView for z/OS Programming: Assembler.
Note: This function has a value only if the message currently being processed was
originally an MDB with an associated source object.
MSGTOKEN() Returns a 1–10 digit decimal number that indicates the token associated with the
message.
&MSGTOKEN
Notes:
1. This function has a value only if the message currently being processed was
originally an MDB.
2. You can use a TOKEN value to group WTOs by setting MSGTOKEN prior to
issuing the WTO command. Subsequently, these messages can be deleted using a
single DOM command by specifying the token value in MSGTOKEN.
MSGTYP() Returns the system message type as a series of three on (1) and off (0) EBCDIC
characters representing the bits in order. An on character (1) in one of the positions
&MSGTYP corresponds to the following:
1 SESS — Corresponds to IFRAUWF1(14)
2 JOBNAMES — Corresponds to IFRAUWF1(9)
3 STATUS — Corresponds to IFRAUWF1(10)
PRTY() Returns the priority of the message as set by the originator. This field is a 1–5 digit
decimal number. The NetView program does not use this field when processing the
&PRTY message.
Note: This function has a value only if the message currently being processed was
originally an MDB.
This field contains the same information as MSGGMID, except that SMSGID is
returned as a decimal number and MSGGMID is returned as a hexadecimal value.
| SYSCONID() Returns the MVS system console name associated with the message. System console
| names are 2–8 characters in length.
&SYSCONID
SYSID() Returns the 1–8 character identifier of the MVS system from which a message arrived.
&SYSID
WTOREPLY Returns an operator reply to a WTOR.
&WTOREPLY REXX
The REXX version is not a function. It is a local variable and therefore does not have
parentheses on the end.
End of REXX
ROUTCDE Examples
/* STANDARD COMPARE */
IF ROUTCDE() = ’000000000000000010000000’
THEN SAY ’ROUTCDE BIT 17 IS SET.’
Figure 10. NetView Command List Language Example to Test for Bit 17
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 61
MSU Information
Figure 11. Using the REXX POS Function to Test for Bit 17
For more information about MSUs, refer to the IBM Tivoli NetView for
z/OS Automation Guide.
The letters represent the resource name and numbers represent the resource type.
The 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.
2. HIER (n) returns the name/type pair aaaaaaaa1111 that corresponds to n. If there is
no name/type pair that corresponds to n, then a null value is returned.
3. HIER(n) returns null under the following conditions:
v If the command list is not run by the automation table
v If the automation table was not driven by an MSU
v If the MSU does not have a hardware monitor resource hierarchy
4. Use the HMSECREC function with HIER to determine the resource name of the
hierarchy level where secondary recording is performed. For more information, see
the description of HMSECREC on page 69.
5. If a complex link exists in a resource hierarchy, there might be resource levels that
do not appear in the information returned by HIER(). You must use a system
schematic to determine the complete hierarchy configuration when a complex link
is present. Use the HMCPLINK function to check whether a complex link exists.
See Table 10 on page 63 for more information about the HMCPLINK function.
6. For information about the NetView built-in function &HIER, see “&HIER” on page
114.
HMASPRID() Returns a 1–9 character alert-sender product ID. This value is identical to the prodid
value described for the SRFILTER (SRF) command. The ID can be one of the following:
v 1–4 character hardware product ID
v 1–9 character software product ID
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 63
MSU Information
Examples of MSUs that HMBLKACT returns a value for include nongeneric alerts
(X'0000'), RECMSs that are not statistics-only, and RECFMSs that are not statistics-only.
HMEPNAU returns the local NAU (domain) name for local MSUs.
For alerts forwarded using the SNA-MDS/LU 6.2 alert forwarding protocol,
HMEPNAU returns the NAU name of the entry point node that contains the MS
application that first forwarded the alert to the ALERT_NETOP application.
HMEPNAU adds an asterisk (*) to the beginning of the NAU name to indicate that the
name returned might not be the entry point node name. For example, if the node
name is NETV01 and HMEPNAU cannot determine if the node is an intermediate
node or the entry point node, it returns *NETV01.
Note: Refer to the IBM Tivoli NetView for z/OS Automation Guide for more information.
If the hardware monitor cannot determine the NETID name of the entry point,
HMEPNET returns an asterisk (*).
HMEPNET returns an asterisk (*), indicating that the NETID name cannot be
determined by the hardware monitor, for all MSUs forwarded by the NV-UNIQ/LUC
alert forwarding protocol.
Note: Refer to the IBM Tivoli NetView for z/OS Automation Guide for more information.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 65
MSU Information
For a complete description of all event types, refer to the NetView online help
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 67
MSU Information
Examples of MSUs that HMGENCAU returns a value for include nongeneric alerts
(X'0000'), RECMS records that are not statistics-only, and RECFMS records that are not
statistics-only.
The resource name returned by HMORIGIN is the same name displayed on the
hardware monitor Alerts Dynamic, Alerts Static, and Alerts History panels when
ALT_ALERT ORIGIN is specified in BNJMBDST. Refer to the IBM Tivoli NetView for
z/OS Administration Reference for information about the statements used in BNJMBDST.
If a complex link does not exist in a resource hierarchy, the resource name returned
with HMORIGIN matches one of the resource names returned with the HIER function.
If a complex link does exist, the resource name might not be one of the names
returned with HIER. Use the HMCPLINK function to determine whether a complex
link exists. For more information, see the description of HMCPLINK, on page 64, and
the description of HIER, on page 63.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 69
MSU Information
The specific component code indicates the generic type of component, subcomponent,
or logical resource that is most closely related to the exception condition that caused
the MSU to be created.For more details about specific component codes, refer to the
information about Basic Alert (X'91') Alert MS subvector in the SNA library. Note that
these codes are valid for RECMS and RECFMS records.
Examples of MSUs that HMSPECAU returns a value for include nongeneric alerts
(X'0000'), RECMS records that are not statistics-only, and RECFMS records that are not
statistics-only.
You can use MSUSEG to retrieve untranslated user-specified data from subvector 33 in
an MSU.
For more information about subvector 33 data, see the UDAT option of the
GENALERT command and the U option of the SRFILTER command.
For complete MSUSEG syntax and some examples of usage, see “MSUSEG Syntax and
Examples” on page 74.
For information about the built-in function &MSUSEG, see “&MSUSEG” on page 117.
| NPDABA(operands) Returns the associated hardware monitor probable-cause and error-description text.
| For complete NPDABA syntax and some examples of usage, see “Probable Cause
| Syntax and Examples” on page 76.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 71
MSU Information
HMBLKACT
/* Example A: The following example checks for a block id */
/* and action code that is not null. */
IF HMBLKACT() ¬= ’’ THEN ....
HMCPLINK
/* Example A: The following example checks for an MSU */
/* with a complex link. */
IF HMCPLINK() = 1 THEN ....
HMEPNETV
/*===================================================================*/
/* Example A: Was the MSU was forwarded from a remote node */
/* entry point NetView over LU 6.2? */
/*===================================================================*/
IF HMEPNETV() = ’1’ THEN ...
HMEVTYPE
/* Example A: The following example checks for hardware */
/* monitor MSUs with an event type of PERM. */
IF HMEVTYPE() = ’PERM’ THEN ....
HMFWDED
/* Example A: The following example checks for hardware */
/* monitor MSUs forwarded from another NetView program */
/* using the NV-UNIQ/LUC.. */
IF HMFWDED() = 1 THEN ....
HMGENCAU
/* Example A: The following example checks for a general */
/* cause code that is not null. */
IF HMGENCAU() ¬= ’’ THEN ....
HMONMSU
Example A shows one way to check for MSUs that have been submitted by the
hardware monitor.
/* Example A */
IF
. HMONMSU() = 1 THEN ...
.
.
Example B shows one way to check for MSUs that have not been submitted by the
hardware monitor.
/* Example B */
IF
. HMONMSU() = 0 THEN ...
.
.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 73
MSU Information
HMORIGIN
/* Example: The following example checks for hardware */
/* monitor MSUs sent from a resource named GENALERT. */
IF HMORIGIN() = ’GENALERT’ THEN ....
HMSECREC
/* Example: The following example checks for secondary */
/* recording on an MSU and displays the resource hierarchy. */
IF HMSECREC() = 1 THEN
DO
SAY ’Secondary recording is being done for an MSU at’
SAY ’resource level: ’ HIER()
SAY ’The name and type pair displayed last is most likely’
SAY ’involved with the error.’
END
HMSPECAU
/* Example A: The following example checks for a specific */
/* component code that is not null. */
IF HMSPECAU() ¬= ’’ THEN ....
HMUSRDAT
/* Example: The following example checks for hardware */
/* monitor MSUs with user specified data of MYDAT in */
/* subvector 33. */
IF HMUSRDAT() = ’MYDAT’ THEN ....
MSUSEG
.
(1)
MSUSEG(' id ' )
H (occ) 1
1
,
byte ,length
where:
byte
Is the byte position into the lowest ID specified in id, counting from 1 in
decimal. Position 1 is the first length byte in the header of the lowest ID. The
header is composed of one or two length bytes followed by the 1- or 2-byte ID.
This entry is optional. The default is 1.
H Is inserted if the first ID is to be obtained from the next higher level
multiple-domain support message unit (MDS-MU) as opposed to the
NMVT/control point management services unit (CP-MSU) level. You can code
the H in uppercase or lowercase. You can place H inside or outside of the
quotes when quotes are coded.
id Is the 2- or 4-character representation of the 1- or 2-byte hexadecimal ID of
GDS, major vector (MV), subvector, subfield, or sub-subfield. The hexadecimal
characters (0–9, A–F, a–f) can be mixed case. The first ID is required; additional
IDs are optional.
length
Is the number of bytes in decimal to be returned from the lowest ID specified
in id and starting at the byte position. This entry is optional. The default is
equal to the remainder of the lowest id specified, and starting at the byte
position.
occ
Is the occurrence number, counting from one (1) in decimal. You can use an
asterisk (*) to specify the first occurrence found. This entry is optional at every
level. The default is 1.
The single quotation marks shown in the REXX syntax diagram are required
only when an occ is specified. If you do not explicitly code an occ, the
quotation marks are optional.
. The period establishes a hierarchy of IDs. Thus, the vector ID specified on the
right side of the period is contained within the vector specified on the left side.
Notes:
1. With MSUSEG(operands), as with other REXX function operands, if operands
are specified, they must be delimited by commas. Two successive commas
indicate an omitted operand.
2. If the location is not found, or if the command list containing the
MSUSEG(operands) was not run by an automation table statement due to an
MSU, or if the function was not driven by an MSU, then the value of the
MSUSEG(operands) is null.
3. If you do not specify a byte position, the data returned includes the 1- or 2-byte
length followed by the 1-or 2-byte ID of the lowest ID specified in id.
4. If the byte position is beyond the end of the location, a null value is returned.
5. If the specified length is longer than what remains at the location specified,
whatever remains at the location is returned.
6. Examples of using MSUSEG(operands) are shown in the figures in “MSUSEG
Syntax and Examples” on page 74.
7. For more information about the automation table, refer to the IBM Tivoli
NetView for z/OS Automation Guide. For more information about vector
definitions, refer to the SNA library. For more LU6.2 and MSU information,
refer to the IBM Tivoli NetView for z/OS Application Programmer’s Guide.
8. For information about using the built-in function &MSUSEG in NetView
command list language CLISTs, see “&MSUSEG” on page 117.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 75
MSU Information
Examples
The following are examples of using the MSUSEG() function:
In Figure 34, the third byte of subvector A0 within the Alert major vector (0000)
starts with ’OPEN’. The Alert can be in any of the supported envelopes.
In Figure 35, Alert subvector A0 has ’LINE’ followed by ’DOWN’ anywhere in it.
Literals can be in hex as well as EBCDIC.
Figure 37 shows an MDS-MU whose first 1212 (CP-MSU) contains a 1323, the first
of which contains any 1326s, the second of which contains 132Bs, the third of
which contains a subvector 01.
IF MSUSEG(’H1212.1323.1326(2).132B(3).01’) ¬= ’’ .....
| NPDABA
| NPDABA('bbbaa')
|
| where:
| bbbaa
| The 5-character string that defines the pre-generic alert:
| v bbb is a hardware monitor block ID.
| The block ID is the code used to identify the IBM hardware or software
| associated with the record.
| v aa is an associated hardware monitor action-code.
| The action code is the specific alert ID within a block ID.
| Examples
| Table 11. NPDABA Examples
| Example Probable Cause
| NPDABA(’FFF03’) ’ADAPTER FEEDBK CHK:COMMUN CTRLR PGM/COMMUN CTRLR’
| The input is 6 characters, which The input is not valid (not a valid hexadecimal number
| is not a valid length. or not 5 characters in length).
| NPDABA(’12345’) ’NOT AVAILABLE’
| The input is 5 characters, but is The hardware monitor does not recognize this
| not a valid block ID and action combination of block ID (123) and action code (45).
| code.
|
|
Operator Information Functions
You can use the following operator information function in REXX command lists
or Data REXX files for the NetView program.
Table 12. Operator Information Functions
Function or Variable Description
OPID() Returns the operator or task ID the same as OPID (’O’). OPID is a 1–8 character
identifier.
&OPID
OPID(’x’) Returns the operator or task ID as a 1–8 character identifier where x is one of the
following:
O Returns the owner’s identity. On a regular OST, it is the same as OPID(), but
on a VOST, it returns the operator ID of the owning OST.
R Returns the operator ID of a remote task controlling the distributed autotask.
If the task is not a distributed autotask, it returns a null.
S Returns the source ID of the operator that originated the command that is
running. Special values, other than the operator ID, might be returned as
follows:
Automation
The command originated in the automation table processing.
(null) The command originated at an optional task or otherwise in
assembler code that specified that the source be ignored.
Note: There is currently no case where the NetView program calls
REXX in this way. Customer-written code or code from other venders
might.
T Returns the target identity, the identity of the task on which the REXX
program is running.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 77
Session Information
&CURSYS
&DOMAIN
DOMAIN(’x’) Returns the 1- to 5-character name of a NetView domain, where x is the following:
R Returns the domain name of a remote task controlling the distributed
autotask. If the task is not a distributed autotask, it returns a null.
| ECVTPSEQ() Is the z/OS product sequence number found in the MVS IHAECVT data area. For
| example, if you are running on z/OS v1.6, ECVTPSEQ returns a value of 01010600.
ENVDATA(’x’) Returns a numeric value or character string, where x is one of the following:
C Returns the screen color count.
D Returns the screen depth (number of rows on the screen).
W Returns the screen width (number of columns on the screen).
G Returns a list of blank delimited entries representing the REXX, PL/I, and C
procedures in the calling sequence or procedure group that was active when
ENVDATA was called.
Each entry consists of two names separated by a slash (/), in the format
command/name. command is the command verb or synonym used to call the
procedure. name is one of the following:
v The module name if the procedure is PL/I or C.
v The member name in DSICLD if the procedure is REXX.
Multiple entries show the calling sequence in reverse order. The command the
operator entered is the last entry listed.
MVSLEVEL() Returns the version of MVS currently running. For example, if you are running
MVS/ESA 4.2.2, MVSLEVEL returns SP4.2.2.
&MVSLEVEL
NETID() Returns the VTAM network identifier. This field has a maximum length of 8
characters. If VTAM has never been active when the NetView program is active, the
&NETID value of NETID is null.
NETVIEW() Returns the version and release of the currently running NetView program. The value
of NETVIEW is a 4-character string in the form of NVvr, where:
&NETVIEW v Indicates the version number of the NetView program
r Indicates the release number of the NetView program
NETVIEW(’x’) Returns a text string, where x is as follows:
T Returns the text string containing the official NetView name.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 79
Session Information
For Data REXX, in addition to PPT, OST, and NNT, any the following can be returned:
DST Data services task
HCT Hardcopy task
MNT Main task
OPT Optional task
UNK Unknown task
Note: This value indicates that an error has occurred. Contact IBM Software
Support for more information.
TASK enables the same command list to run under any of these tasks because the
command list can test for the task type and process accordingly. For example, there are
some restrictions for command lists running under the PPT. See “Primary POI Task
Restrictions” on page 12.
Strings that end with an asterisk (*) return the names of the towers and subtowers that
are enabled. Note that asterisks can be either used alone or used together with a tower
name to determine the subtowers that are enabled. For example, assume that the AON
tower and the SNA and TCP subtowers are enabled, SAY TOWER(’*’) would return AON
SNA TCP and SAY TOWER(’aon.*’) would return SNA TCP.
Notes:
1. Input strings are not case sensitive and mixed case strings can be returned.
2. Tower and subtower combinations must be concatenated with a period (.).
| 3. Towers and subtowers are enabled in CNMSTYLE and its included members. Refer
| to the IBM Tivoli NetView for z/OS Administration Reference for more information.
TYPE() Returns a 3-character string that indicates the level of the NetView program that is
installed. Possible values are:
ENT Enterprise option
SYS NetView System Services
VTAM() Returns the version and release of VTAM as a 4-character string in the form of either
VTvr or Vvrm, where:
&VTAM v Is the version number
r Is the release number
m Is the modification number
Note: The value of VTAM is null if the VTAM program is not active.
VTCOMPID() Returns the 14-character VTAM component identifier. The VTAM component
identifiers are:
&VTCOMPID MVS/ESA 5685-08501-xxx (for VTAM Version 3)
MVS/ESA 5695-11701-xxx (for VTAM Version 4)
MVS/XA 5665-28901-xxx
VSE/ESA 5666-36301-xxx
VM/SP 5664-28001-xxx
VM/9370 5684-05201-xxx
VM/ESA 5684-09501-xxx
where xxx is the release number.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 81
REXX Environment and Terminal Information
Refer to the IBM Tivoli NetView for z/OS Tuning Guide for the rationale on the use
of these functions.
Note: Refer to the DEFAULTS command and the OVERRIDE command in the
NetView online help for more information about the meaning of the
following REXX values. These functions return a null value for operating
systems other than MVS/XA, MVS/ESA, and VSE/ESA.
Table 14. REXX Environment Information Functions
Function or Variable Description
RXDEFENV() Returns the default number of NetView REXX environments set by the REXXENV
parameter of the DEFAULTS command.
&RXDEFENV
RXDEFSTR() Returns the default NetView REXX environment initial storage size set by the
REXXSTOR parameter of the DEFAULTS command. This value can be -1 if REXXSTOR
&RXDEFSTR was set to the default or was never set.
RXNUMENV() Returns the current number of REXX environments initialized for this task. For
RXNUMENV(), this number is always at least 1, representing the REXX environment
&RXNUMENV currently running. For &RXNUMENV, this number can be zero (0).
RXOVRENV() Returns the override number of NetView REXX environments set by the REXXENV
parameter of the OVERRIDE command. If the number of REXX environments has not
&RXOVRENV been overridden or is set to the default value, a null value is returned.
RXOVRSTR() Returns the override NetView REXX environment initial storage size set by the
REXXSTOR parameter of the DEFAULTS command. If the REXX initial storage size has
&RXOVRSTR not been overridden or is set to the default value, a null value is returned.
&LU
Note: Because &TIME and &DATE are separate variables, you might need extra
coding to determine the correctly matched time and date. For example, if
you get &DATE first, midnight can occur before you get &TIME, so you
have the wrong date for the current time. If you get &TIME first, midnight
can occur before you get &DATE, so you would have the wrong time for the
current date.
The following is an example of some NetView command list language code that
can help you determine if you have the correct date and time:
-RETRY
&TDATE = &DATE
&TTIME = &TIME
&IF &TDATE NE &DATE &THEN &GOTO RETRY
&WRITE &TDATE &TTIME
REXX provides equivalent but more comprehensive time and date functions. For
more information, refer to the REXX library.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 83
Nulls and Blanks Stripping
| As a result, the automation table can change display, logging, routing, or almost
| any other disposition of the message. Commands or command lists can be called
| to analyze the message or MSU either before or in addition to any action taken.
For a complete definition of the syntax of the NetView automation statement, refer
to the IBM Tivoli NetView for z/OS Automation Guide. For the syntax of the
AUTOTBL command, refer to the NetView online help.
For more information about the MSGROUTE command, refer to the NetView
online help.
Suppressing Messages
You can suppress some messages so that no operator receives them. To suppress
messages with NetView automation, make an entry in the NetView automation
member. Assume, for example, that you do not want the message IST4001
TERMINATION IN PROGRESS FOR APPLID applnm to be displayed. The following
example shows the NetView automation statement:
IF MSGID=’IST400I’ THEN DISPLAY(N);
In NetView command list language, if you are not sure of the type of task or
condition under which a command list is to run, have the command list check the
&TASK control variable or AUTOTASK function in the beginning of the command
list. You can then use conditional processing to make the command list flexible
enough to run differently under different tasks. See Appendix B, “NetView
Command List Language Branching,” on page 123 for more information about
conditional processing.
| After this temporary automation is invoked, with the subject message held on your
| NCCF screen, you can use the HELDMSG stage to create accurate copies for
| testing. You can test this by issuing the TS command to cause tracing and then
| issue a command such as this:
| PIPE HELDMSG | NETV CMD (DIRECT) yourcmd yourarguments
| If there is more than one held message on the NCCF screen, you may also need to
| add a LOCATE or TAKE stage. After the PIPE HELDMSG command completes,
| yourcmd will be running outside of pipelines, and functions such as JOBNAME()
| and PIPE SAFE * in your procedure will return accurate results from the current
| message provided by the pipeline.
| You can stop this command and then reissued the TS and the pipe command to
| test repeatedly.
From a REXX command list, use the SAY instruction with the message ID and
message text in quotes.
From NetView command list language, use the &WRITE statement with the
message ID and message text in quotes.
If the message you create matches an entry in the NetView automation table, the
table processes any actions specified for that entry. Through this process, you can
test NetView automation table entries. This method works only if limited
information, such as the message identifier and message text, is checked in the
NetView automation table entry.
For example, each automation command list could send a message to the log
containing the name of the command list and the parameters passed upon entry.
The task from which the message is issued and the time of the logged message are
automatically saved in the log. You can remove these MSG commands from the
automation command lists when testing is successfully completed.
To test NetView command list language automation command lists by tracing their
processing, use the &CONTROL statement. If your command list is being run by a
NetView automated operator (autotask), the results of &WRITE, &BEGWRITE, or
&CONTROL are not visible unless the autotask is assigned an MVS console. The
results are visible in the network log regardless of whether the autotask is assigned
to a console. Refer to the AUTOTASK command in the NetView online help for
more information about assigning an autotask to an MVS console.
The NetView command list language wait statements are &WAIT and &PAUSE.
For example, in NetView command list language, using either &PAUSE or &WAIT
statement and requiring a GO command is not appropriate.
Consider how messages from a command list affect operator requests, and try to
make automation command lists interfere as little as possible, because automation
runs at the same time operators enter requests.
For REXX, you must change the setting of the MCSFLAG variable for the WTO to
be displayed.
For command list, you must change the setting of the &MCSFLAG control variable
for the WTO to be displayed.
Refer to the PARSEL2R command in the NetView online help for an example of
how to change a function or control variable.
The NetView command list language MLWTO line type variable is &LINETYPE.
All except global variables are described in detail in later sections of this chapter.
Global variables and descriptions of passing parameter values are described in
Appendix C, “NetView Command List Language Global Variables,” on page 141.
The NetView command list language enables you to write application code to
perform repetitive or alternate processing (loop or if-then structures). These
features are implemented with the following control statements:
v &IF
v &GOTO
v &EXIT
v &WAIT
| Note: Command lists can interrupt the processing of other command lists. This is
| done using the CMDDEF statement in CNMCMD.
Note: Do not code a comment between the beginning and end of a continued
statement.
v The plus sign causes the text of the continuation line to begin where the plus
sign was placed without any of the blanks leading up to the first nonblank
character on the continued line.
The plus sign causes these lines:
&WRITE THIS STATEMENT IS CODED +
AS +
THREE LINES
with characters from the beginning of the continuation line. The hyphen is
replaced by a blank. When filling a line with characters from the beginning of
the continuation line, NetView does not split a word across lines of an output
screen. The last character used for filling in from the continuation line must be a
blank or the last character on the line.
For example, if you coded the following &WRITE statement to be displayed on
an 80-character-wide terminal:
&WRITE STATEMENT CONTINUED WITH THE HYPHEN TO KEEP -
BLANKS
All the blanks from the P in KEEP to the B in BLANKS would be kept. The first line
would write 64 characters to the output screen (43 characters of text plus 21
blanks from the end of the text to column 72). The output screen has 68 columns
to be used for display (80 minus the 12-character prefix), so the hyphen would
cause the first four characters of the second line to be placed at the end of the
first line. In the example, this would be two blanks and the letters BL. However,
because the NetView program does not split a word across lines of the output
screen, the message is displayed as:
STATEMENT CONTINUED WITH THE HYPHEN TO KEEP
BLANKS
In Figure 38, the control variable &SUPPCHAR is replaced with the character
defined as a suppression character. The last line of the command list in the
example is suppressed.
&CONTROL CMD
* COMMAND LIST UPDATED 2/5/95 BY OPERATOR CARL
START DOMAIN=&1
&WRITE ENTER GO WHEN MESSAGE DSI809I ARRIVES FROM &1
&PAUSE
&SUPPCHAR ROUTE &1,OPER1,123456
When issuing a command that returns its status in the return code, you can
suppress synchronous output from the command by coding the suppression
character twice. For example, if you use the following code in a command list, no
synchronous output from the command list is displayed to the operator:
&DOUBLESUPP = &CONCAT &SUPPCHAR &SUPPCHAR
&DOUBLESUPP SET PF24 IMMED RETRIEVE
Use the double suppression character when sufficient status is provided by the
return code and to enhance performance on commands that produce line mode
messages synchronously. Using the double suppression character does not affect
output that is scheduled by a command (for example, D NET,APPLS), nor does it
consistently reduce output from a long-running command (for example, NLDM).
Labels
Labels identify command list statements for control of flow, for internal
documentation, or to indicate the target statement for a transfer of control.
Transferring control is explained in Appendix B, “NetView Command List
Language Branching,” on page 123.
You can code labels on any command list statement except a comment statement.
You can code labels on commands, control statements, assignment statements, and
null statements. If NetView cannot find the label, processing stops, and NetView
issues an error message.
A label must be the first nonblank word on a command list line. A label consists of
an EBCDIC hyphen (-) followed by 1 to 11 characters (A-Z, 0-9, #, @, $). You do
not have to code a command list statement after a label. If you do, however, start
the command list statement after the label, leaving at least one blank between the
label and a keyword.
You can also code other labels. All labels must be unique within a command list. If
you have two identical labels in one command list, NetView ends the command
list. You can also code labels as internal comments to show where different parts of
your command list start. For example, you can use labels to highlight certain
processing routines.
Note: Labels are used with &BEGWRITE to show where a message stops.
Variables are not allowed in labels, but you can code a variable as the label
name with the &BEGWRITE, &GOTO, or &WAIT statements. These
statements for transfer of control are described in Appendix B, “NetView
Command List Language Branching,” on page 123.
Variables
Variables enable you to accept from an operator, or define for yourself, different
values for the statements within a command list. With the following variables, you
can write a command list that operates correctly in many different situations:
v Parameter
v Control
v User
v Global
This section describes how to use parameter, control, and user variables. This
section also describes how to use the NetView PARSEL2R command to parse
variables in a command list. See Appendix C, “NetView Command List Language
Global Variables,” on page 141 for a description of global variables.
Code the variable as the first nonblank word in the command list.
Note: The value of X'50' (ampersand in the EBCDIC character set) is ignored
within double-byte character sets. If you want to use an ampersand,
end the string using a shift-in (X'0F') control character and enter the
variable. To resume the string, begin the string using a shift-out (X'0E')
control character.
2. The scan resumes at the next character to the left, and the search for an
ampersand continues. If found, the ampersand and the entire syntactical
element to the right, including the previous substitution, are taken as the name
of a variable and are replaced by the variable value.
Parameter Variables
A parameter variable is a positional variable that is defined at the time a command
list is run. Specify parameter variables by entering them as operands following the
name of the command list that you are running. Parameter variables have the
following characteristics:
v Identified within the command list by a numbered position, for example, &1
v Entered following the command list name at run time
v Delimited by commas, apostrophes, or blanks
When you code your command list with parameter variables, use the following
guidelines:
v You can use up to 31 parameter variables in a single command list.
v You can use the same parameter variables more than once in a command list.
v The value of a parameter variable can be 238 characters long.
v Parameter variables can contain either numerical or character values.
v When used in an arithmetic expression (for example, addition or subtraction), a
parameter variable can have a numerical value between -2147483647 and
2147483647. When used in a non-arithmetic expression (for example, assignment
statements, &IF statements, &CONCAT, or &SUBSTR statements), a parameter
variable can have a value up to 238 digits long, including the sign.
&MSGCNT, and &MSGSTR) and also changes the values of the parameter
variables (&1 – &31) to reflect the information in the received message.
See “Control Variables” on page 100 for information about these variables.
LINKPD sets the same control and parameter variables. See “LINKPD Results” on
page 151 for more information about the LINKPD command.
The first value after the command list name replaces &1 in the command list, the
next value replaces &2, and so on. For example, the second parameter variable in a
command list would be coded &2 at the place where you want the value of that
parameter.
Assume that you wrote a command list named RESC to start resource LU100 as
shown in the following example.
RESC CLIST
&CONTROL ERR
VARY NET,ACT,ID=LU100
If you want the command list to use parameter variables, you can change it to
activate or inactivate any resource. The following example shows how the
command list looks with parameter variables:
RESC CLIST
&CONTROL ERR
VARY NET,&1,ID=&2;
The operator can then start resource LU100 by entering RESC ACT,LU100.
When the command list runs, &1 and &2 are replaced with the following
positional parameters:
v &1 with ACT
v &2 with LU100.
The command list takes the values for &1 and &2 from the entered operands in the
order in which the operands are entered after the command list name.
Note: The operator who uses the command list must be told how many parameter
variables to supply and what values to provide.
&1 is given the first value the operator enters, and &2 is given the second value.
If there are two or more parameter variables in one command list statement, the
rightmost variable is changed first. The NetView program continues to scan right
to left and replaces the next variable. You can use this method to change the
meaning of some of your parameter variables. If you need to test how many
parameters an operator entered or what parameter values were entered, use the
control variables &PARMCNT and &PARMSTR. They are described in “Control
Variables” on page 100.
&A = 55
MINOR &A,&1,&2
Command list MINOR takes the value of &A (55) as its first parameter, the value
of MAJOR’s first parameter (ALPHA) as its second parameter, and the value of
MAJOR’s second parameter (BETA) as its third parameter.
If you need to pass a nested command list a variable containing a quoted string,
enclose the variable in single quotation marks on the nested command list call. In
the following example, CLIST1 calls CLIST2:
CLIST1 CLIST
&STR = &1
CLIST2 ’&STR’
&EXIT
Note: The parameter variable on the nested command list call must be surrounded
by quotation marks.
A NetView command list language quoted string is any text that meets one of the
following requirements:
v Text preceded by a delimiter and a single quotation mark, followed by either a
single quotation mark and a delimiter or a single quotation mark that is the
rightmost nonblank character
v Text preceded by a single quotation mark that is the leftmost nonblank character,
followed by a single quotation mark and a delimiter
v Text preceded by a single quotation mark that is the leftmost nonblank character,
followed by a single quotation mark that is the rightmost nonblank character.
Suppose you activate a command list name RESC by entering the following:
RESC ACT,’LU200,LOGMODE=S3270’
The parameter variables in the RESC command list would contain the following
values:
&1 = ACT
&2 = LU200,LOGMODE=S3270
If you do not want to specify all the values, you can enter the following:
CONN TSO,TAF01F00,,,PF12
In this example, &1 is TSO, &2 is TAF01F00, &3 and &4 are null, and &5 is PF12.
The extra commas between TAF01F00 and PF12 represent positional place holders
for &3 and &4, and tells the command list that they are null. If you use only one
comma, the command list takes PF12 as &3 and incorrectly uses PF12 as the
LOGMODE.
Test for null parameter variables in your command list and provide default values
to avoid possible syntax errors.
Control Variables
The following sections describe the control variables as used in NetView command
list language.
Control variables are set by the NetView program based on system information. To
use a control variable, place the variable name in the command list at the location
where you want the information to be accessed. When the command list runs,
NetView gives the correct values to each control variable. Use the LISTVAR
command to view the values of some of the control variables.
For more information about control variables used with the SPCS commands
LINKDATA and LINKTEST, see “LINKDATA and LINKTEST Results” on page 150.
Note: A command list can create a user variable that the NetView program has
already defined as a control statement, control variable, or built-in function.
However, if such a user variable is created, you cannot use that NetView
provided control statement, control variable, or built-in function in that
command list anymore.
User Variables
User variables are variables you create and set within the command list. You can
set user variables with an assignment statement or an &PAUSE control statement.
The &PAUSE control statement halts the command list, enables the operator to
enter data, and picks up the value of the user variable from the operator when the
command list continues. &PAUSE is described in “&PAUSE Control Statement” on
page 108.
Note: A command list can create a user variable that the NetView program has
already defined as a control statement, control variable, or built-in function.
However, you cannot use that NetView-provided control statement, control
variable, or built-in function anymore in the command list.
Hexadecimal Notation
The NetView command list language provides a hexadecimal notation capability to
process hexadecimal data. You can use hexadecimal notation anywhere you can
use a command list variable, except as the receiver in an assignment statement.
The following syntax describes the hexadecimal notation for the NetView
command list language:
X'n'
where:
n Is an even or odd number of hexadecimal digits (0-9 or A-F in uppercase) with
no embedded blanks. If n is an odd number of digits, the NetView program
prefixes the number with a zero (for example, X'2C6' would be converted to
two bytes whose hex value would be 02C6). The maximum length of n is 255
hexadecimal digits.
The following are examples of the use of hexadecimal notation:
&A = X'3B9' &IF &A = X'3B9' &THEN....
Comments
It can be helpful to code comments in a command list. Command lists with
comments are easier to maintain and expand than command lists without
comments.
To write a comment, code an asterisk (*) as the first nonblank character of the
command list line. Be sure that you do not use a string of hyphens to separate
sections of the command list.
Null Statements
A null statement contains all blanks or a label followed by all blanks. A null
statement with a label can be the target of flow control (conditional processing)
statements or &BEGWRITE statements. See “Labels” on page 94 for details about
using labels.
You can use a null statement to help format a message to the operator or to break
up a long command list so that it is easier to read and update. If a null statement
is part of a message written with an &BEGWRITE statement, it is sent to the
operator as a blank line. If a null statement is used to break up the command list,
NetView ignores the statement when the command list is run.
Assignment Statements
Assignment statements give values to variables and do arithmetic operations
within a command list. The syntax of an assignment statement is:
assignment
&variable = expression
When the command list runs, the value of the user variable is set to the value of
the expression. For example, the assignment statement &A = 5 sets the &A to 5.
The assignment statement &B = &1 sets the &B to the value of &1, and &1 keeps
its value.
&PARMVAR = &4
The value of control variable &PARMCNT is subtracted from 38, and the
resulting value is assigned to variable &SUM.
In arithmetic expressions with leading zeros, the leading zeros are not
shown in the result. For example, assume &A is 01 and you code the
following:
&C = &A + 1
Control Statements
Control statements are unique command list statements that control the way the
NetView program acts on other statements in the command list. You can use the
control statements in this chapter either for straight-line coding or in conjunction
with the statements described in Appendix B, “NetView Command List Language
Branching,” on page 123 for conditional processing.
You can use control statements to change the sequential order of processing.
Command list control statements enable you to:
v Send messages to the operator from the command list.
v Control the order in which commands are run.
v Ask the operator to enter information needed to continue the command list.
v Wait for a solicited message to arrive before continuing the command list.
Each command list control statement begins with the control symbol in the form
&word. Only one control statement can be coded on a line, except when using &IF.
After reading the descriptions of the control statements, you should have a general
idea of the capability of these basic statements. Read the sections that follow for
details concerning each control statement.
&CONTROL Statement
The &CONTROL statement lets you indicate which command list statements are
displayed at the operator’s terminal while the command list is running. The
indicated command list statements are displayed after all substitutions have been
made and before the command list statements run. You can use the display of the
command list statements from &CONTROL ALL or &CONTROL CMD to help
debug your command list.
Set &CONTROL at the beginning of the command list. You can change the
&CONTROL setting within the command list as many times as necessary.
&CONTROL is in effect from that point in the command list until the next
&CONTROL statement is reached. For example, if you just added a new section of
code to a command list, you can display the entire new section of code but view
only the errors for the existing sections of code. Code this control statement by
typing &CONTROL followed by a blank and an operand. The syntax of the
&CONTROL control statement is:
&CONTROL
ALL
&CONTROL
CMD
ERR
where:
ALL
Displays all command list statements at the operator’s terminal. Each statement
is displayed just before it is processed. &CONTROL ALL is a good choice
when you first write the command list and want to test it. Once your
command list is tested, &CONTROL CMD or &CONTROL ERR is a better
choice. When processing for this command list is complete, the following
message is displayed:
DSI013I COMMAND LIST clistname COMPLETE
The messages are sent to the operator regardless of the &CONTROL setting. If you
code a command on an &WRITE control statement, the text is sent to the operator
as a message, but it is not run as a command list command.
Do not confuse the use of &WRITE and &BEGWRITE with the use of command
list comments. Comments are for the person writing the command list and are not
sent to the operator, unless &CONTROL ALL is set. &WRITE and &BEGWRITE
send messages to the operator.
If you are sending more than one message line or displaying a table that takes up
the whole screen, you might want to use the NetView VIEW command instead of
using &WRITE or &BEGWRITE.
text, use &BEGWRITE. If you do not include message text, the NetView program
sends a blank line to the operator. The syntax for the &WRITE statement is:
&WRITE
&WRITE message_text
If you want to include blanks in front of the first character of the line, code a
nonblank character after &WRITE.
Otherwise, the line shifts left until the first nonblank character is in column 1.
The following is an example of a command list called PATH that uses the &WRITE
control statement and a VTAM command.
PATH CLIST
&CONTROL CMD
* THIS COMMAND LIST DISPLAYS INFO ON VTAM SWITCHED PATHS
&WRITE *** STATUS OF VTAM SWITCHED PATHS FOR &1 ***
D NET,PATHS,ID=&1
Notice that the &1 in the &WRITE statement is replaced by the value HD3790N1
before it is sent to the operator. Because &CONTROL CMD was coded, the
command is also shown. The rest of the display is the response to the VTAM
command.
Figure 41 on page 107 shows several &WRITE statements, which send one-line
messages to the operator.
CLEAR
&WRITE >>> THE SUM OF &ONE + &TWO IS --->&SUM
Code the &BEGWRITE statement on a line by itself, one line above the first
operator message you want to send. You can also specify a label on &BEGWRITE.
The label tells the command list where the messages end and command list
processing continues. See “Labels” on page 94 for more information about labels.
You can indicate that you want variables replaced by their actual values before the
messages are sent to the operator. If you do not indicate a choice, variables are not
replaced.
&BEGWRITE
NOSUB
&BEGWRITE
SUB −label
where:
-label
Indicates the line that follows the text to be displayed to the operator. If you
code a label in the statement, this label must be on a statement following the
end of the message text lines in the command list. The command list lines
between &BEGWRITE and the statement with the label are sent to the
operator. The command list statement with the label is not sent to the operator;
it is processed as the next command list statement. If the NetView program
cannot find the label, the rest of the command list statements are sent to the
operator as comments and the command list is ended. If there is no label on
&BEGWRITE, only the first command list statement after &BEGWRITE is sent
to the operator.
You can code a variable for your label on &BEGWRITE. Replace the variable
with a valid value.
NOSUB
Writes the messages to the operator exactly as they are typed, with no variable
substitution. In other words, &1 is sent as &1, not as the value of &1. Use this
operand to write about the command list variables in your messages. NOSUB
does not remove blanks. It displays the text exactly as it is entered. If you code
&BEGWRITE without an operand, the NetView program assumes NOSUB.
SUB
Causes the NetView program to carry out substitution on the message text
before sending the messages to the operator. See “Variable Substitution Order”
on page 95 for information about how the NetView program carries out
variable substitution.
If there are blanks before the first character on a message line, the line is
shifted left until the first nonblank character is in column 1. If you want the
blanks sent to the operator’s screen, code a nonblank character in column 1. If
you are using &BEGWRITE to write a message containing double-byte
character set (DBCS) characters, you must use the SUB option. These coding
rules are the same as those for &WRITE.
In some cases, you might not want variable substitution. In the following example,
the &BEGWRITE statement shows the operator how to use the ENDIT command
list:
&CONTROL ERR
&BEGWRITE NOSUB -OVER
TO END FULL SCREEN SESSIONS,
TYPE "ENDIT &1,&2,&3"
REPLACE &1,&2,&3 WITH
THE APPLID NAMES OF THE
FLSCN SESSIONS TO BE ENDED
-OVER
The ENDIT command list is called by entering ENDIT. Figure 43 shows the
messages that the operator sees when ENDIT is used.
Notice that &1, &2, and &3 are not replaced by their values when the messages are
sent to the operator.
Then code the &PAUSE statement to temporarily halt the command list. The
command list pauses until the operator enters the GO command to continue
processing, or the RESET command to end the command list. You can code the
&PAUSE command to enable the command list to pick up the operands following
the GO commands and take them as user variables. See “User Variables” on page
100 for more information.
Notes:
1. Using &PAUSE in an automation task command list or a command list that
runs under the PPT is not valid.
2. The VIEW command obtains operator input without requiring the use of the
GO command.
&PAUSE
NOINPUT
&PAUSE
VARS variable
STRING variable
where:
NOINPUT
Pauses until the operator enters the GO or RESET command. Operands cannot
be specified with the GO command. If the operator enters operands, an error
message is returned. NOINPUT is the default.
STRING variable
Pauses until the operator enters the GO command with or without a string, or
the RESET command. A previous &WRITE or &BEGWRITE statement notifies
the operator to enter operands with the GO command. The entire string of
operands is taken as one user variable. The variable can then be used in the
command lists.
VARS variable
Pauses until the operator enters the GO command with or without the correct
number of operands, or the RESET command. A previous &WRITE or
&BEGWRITE statement notifies the operator to enter operands with the GO
command. Each operand is taken as a user variable coded on the &PAUSE
VARS statement. These variables can then be used in the command list.
When the command list interprets an &PAUSE control statement, the letter P
appears in the upper right corner of the panel to alert the operator that the
command list is in pause state. Pause state means that the command list has halted
and is waiting for input from the terminal.
Note: If a command list in pause state was called by an NNT session, the P
indicator is not displayed on the OST panel.
STACK and UNSTACK enable the operator to suspend and then resume command
list processing during an &PAUSE. Once the STACK is issued, the operator can
enter any network command.
The operands on the GO command are positional. This means the first operand
becomes the first user variable, the second operand becomes the second user
variable, and so on. Operands are separated by either a blank or a comma. If you
want to include a blank or a comma as part of one variable, use either &PAUSE
STRING or put the operand between single quotation marks.
Code a user variable for each expected operand. If the operator enters more
operands on the GO command than expected by the command list, the extra
operands are ignored. If the operator enters fewer operands than expected, the
remaining variables are set to null. The operator can also skip over one operand by
coding two commas in a row.
Precede the pauses for operator input with messages that supply the information
to enter. Use the &WRITE or &BEGWRITE statements to send this information.
Note: The operator can call your command list from any NetView component. If
you expect the command list to run from components other than the
command facility, use the NetView command NCCF in the command lists to
present the operator with the command facility panel and command panel
input area. (Do this before issuing any messages.) If the command list is
running in the command facility, the NCCF command has no effect. Refer to
the NetView online help for more information about NetView commands.
The example writes a message to the operator prompting for the operator’s last
name, first name, and middle initial. The command list pauses until the operator
enters a GO or RESET command. To continue processing the current command list,
the operator enters the GO command followed by the string required by the
command list.
The value of &LAST becomes SMITH, the value of &FIRST becomes JOHN, and
the value of &MI becomes A. These variables can then be used by other statements
in the command list.
Do not confuse built-in functions with variables of the same name. (All NetView
command list language variables are described in Chapter 4, “REXX Instructions
for NetView REXX Command Lists and Data REXX Files,” on page 37.) Although
they appear similar, they are not the same. With the exception of HIER() and
MSUSEG(), both built-in functions and NetView command list language variables
start with an ampersand (&). The difference is as follows:
v A variable is replaced by its value when the command list runs. The variable is
really just a placeholder for the value.
v A built-in function is never replaced by a value. A built-in function is an action
indicator rather than a placeholder.
In an &IF control statement, the result of the built-in function is used as one or
both of the compared expressions. For example, you might use the &LENGTH
built-in function to compare the lengths of two variables.
&BITAND
The &BITAND function returns a string composed of the two input strings
logically ANDed together, bit by bit. The length of the result is the length of the
longer of the two strings. If the AND operation ends when the shorter of the two
strings is exhausted, the unprocessed portion of the longer string is appended to
the partial result. If the value of both strings is null, the result is a null string.
&BITAND
&BITAND string1
string2
where:
string1
Can be either a constant or a command list variable.
string2
Can be either a constant or a command list variable.
&BITOR
The &BITOR function returns a string composed of the two input strings logically
ORed together, bit by bit. The length of the result is the length of the longer of the
two strings. If the OR operation ends when the shorter of the two strings is
exhausted, the unprocessed portion of the longer string is appended to the partial
result. If the value of both strings is null, the result is a null string.
&BITOR
&BITOR string1
string2
where:
string1
Can be either a constant or a command list variable.
string2
Can be either a constant or a command list variable.
2. If you specify more than one string, message DSI186I is issued and the
command list ends. This is consistent with the equivalent REXX function.
3. If you do not specify string1, message DSI187I is issued and the command list
ends. This is consistent with the equivalent REXX function.
&BITXOR
The &BITXOR function returns a string composed of the two input strings logically
exclusive ORed together, bit by bit. The length of the result is the length of the
longer of the two strings. If the XOR operation ends when the shorter of the two
strings is exhausted, the unprocessed portion of the longer string is appended to
the partial result. If the value of both strings is null, the result is a null string.
&BITXOR
&BITXOR string1
string2
where:
string1
Can be either a constant or a command list variable.
string2
Can be either a constant or a command list variable.
&CONCAT
The &CONCAT function concatenates the values of two variables, two constants,
or a variable and a constant to form a new value. The syntax of the &CONCAT
built-in function is:
&CONCAT
Ensure that when the two items are joined, the resulting value does not exceed the
maximum of 255 characters; higher values are truncated. If the value of both items
being joined is null, the result is null.
&PREFIX = SN/
&ID = 5497
&SERIAL = &CONCAT &PREFIX &ID
&HIER
The &HIER function provides user access to the NetView hardware monitor
hierarchy data associated with an MSU.
HIER
&HIER
n
where:
n Specifies the index number (1–5) of a specific name/type pair.
Notes:
1. &HIER without n returns a resource hierarchy slightly different than that found
in BNJ146I messages. The name/type pairs look like:
aaaaaaaa1111bbbbbbbb2222....eeeeeeee5555
The letters represent the resource name and numbers represent the resource
type.
The 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.
2. &HIER with n returns the name/type pair, such as aaaaaaaa1111 that
corresponds to n. If there is no name/type pair that corresponds to n, then a
null value is returned.
3. &HIER returns null under the following conditions:
v If the command list is not run by the automation table
v If the automation table was not driven by an MSU
v If the MSU does not have a hardware monitor resource hierarchy
4. 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 44
on page 115.
5. If a complex link exists in a resource hierarchy, there might be resource levels
that do not appear in the information returned by the &HIER function. 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
*
&LENGTH
The &LENGTH function returns the length of a variable or a constant. The syntax
of &LENGTH is:
&LENGTH
&LENGTH variable
constant
The length of the variable value or constant is returned. If the variable is null or
the constant is a null string, the value returned is 0.
SAMP CLIST
&HCLENGTH = &LENGTH &HCOPY
&RESLEN = &LENGTH &1
User variable &HCLENGTH is set to the length of the hardcopy device name. The
hardcopy device is HC55. HC55 has four characters, so &HCLENGTH becomes 4.
&RESLEN becomes the length of the first parameter variable. The first parameter
variable is LU2525, so &RESLEN becomes 6.
116 Programming: REXX and the NetView Command List Language
Built-In Functions
&MSUSEG
The &MSUSEG function provides the parsing capability needed to extract
information from a management services unit (MSU) or other similarly architected
pieces of data. Use this function in a command list that is called by the NetView
automation table or an LU6.2 application.
&MSUSEG
.
(1)
&MSUSEG id
H (occ) 1
,
byte ,length
where:
byte
The byte position into the lowest ID specified in id, counting from 1 in
decimal. Position 1 is the first length byte in the header of the lowest ID. The
header is composed of one or two length bytes followed by the 1- or 2-byte ID.
This entry is optional. The default is 1.
H Is inserted if the first ID is to be obtained from the next higher level
multiple-domain support message unit (MDS-MU) as opposed to the
NMVT/control point management services unit (CP-MSU) level. You can code
the H in uppercase or lowercase. You can place H inside or outside of the
quotation marks when quotation marks are coded.
id Is the 2- or 4-character representation of 1- or 2-byte hexadecimal ID of GDS,
major vector (MV), subvector, subfield, or sub-subfield. The hexadecimal
characters (0–9, A–F, a–f) can be mixed case. The first ID is required; additional
IDs are optional.
length
Is the number of bytes in decimal to be returned from the lowest ID specified
in id and starting at the byte position. This entry is optional. The default is
equal to the remainder of the lowest id specified, and starting at the byte
position.
occ
The occurrence number, counting from one (1) in decimal. You can use an
asterisk (*) to specify the first occurrence found. This entry is optional at every
level. The default is 1.
. The period establishes a hierarchy of IDs. Thus, the vector ID specified on the
right side of the period is contained within the vector specified on the left side.
Notes:
1. You can use blanks as delimiters between operands, but blanks do not act as
place holders. For example, if you code a variable for the byte and the value of
the variable is null and you used a blank as a delimiter, the length is considered
to be the byte operand.
2. If the location is not found, or if the command list containing the &MSUSEG
function was not processed by an automation table statement because of an
MSU, or if the function was not driven by an MSU, then the value of the
&MSUSEG function is null.
3. If you do not specify a byte position, the data returned includes the 1- or 2-byte
length followed by the 1-or 2-byte ID of the lowest ID specified in id.
4. If the byte position is beyond the end of the location, a null value is returned.
5. If the specified length is longer than what remains at the location specified,
whatever remains at the location is returned.
For more information about the automation table, refer to the IBM Tivoli NetView
for z/OS Automation Guide. For more information about vector definitions, refer to
the SNA library. For more LU6.2 and MSU information, refer to the IBM Tivoli
NetView for z/OS Application Programmer’s Guide.
&NCCFID
| The &NCCFID function returns the NetView domain identifier of a domain with
| which you can establish a cross-domain session. The domains with which you can
| establish cross-domain sessions are defined by the DOMAINS statement of your
| operator profile. However, if your profile specifies AUTH CTL=GLOBAL, you can
| establish cross-domain sessions with the domains specified by the RRD statements
| in CNMSTYLE or its included members. If you do not specify DOMAINS or
| CTL=GLOBAL in the operator profile, you receive an error message when using
| this function.
For more information about the domains and RRD statements, refer to the IBM
Tivoli NetView for z/OS Administration Reference.
&NCCFID
&NCCFID number
where:
number
Is either a number or a variable that becomes a number. The largest number
permitted is the value of &NCCFCNT, the control variable that shows the total
number of cross-domain sessions this operator can start.
The command list can use &NCCFID to automatically start or stop a cross-domain
session.
Assume your operator profile defines three domains with which you can establish
cross-domain sessions:
1 ALPHA
2 BETA
3 GAMMA
The three domains are then started with the NetView START command.
In this example, the operator must know there are three domains that can be
started. You can also use the &IF control statement to test &NCCFCNT to find the
number of domains and start them.
&NCCFSTAT
The &NCCFSTAT function returns a value indicating whether you have an active
cross-domain session with the specified domain. The syntax of &NCCFSTAT is:
&NCCFSTAT
&NCCFSTAT domain
where:
domain
Is either a domain name or a variable that becomes a domain name.
The function call is replaced by the characters ACT if the operator has an active
cross-domain session with the domain. The function call is replaced by the
characters INACT if the operator does not have an active cross-domain session
with the domain.
For example, you can write a command list to check the status of a domain and
start that domain if it is not active. Assume you activated the STARTEM command
list in the following example by entering STARTEM NCCFA.
STARTEM CLIST
&CONTROL ERR
&STATUS = &NCCFSTAT &1
&IF &STATUS = INACT &THEN START DOMAIN=&1
&IF &STATUS = ACT &THEN &WRITE DOMAIN &1 IS ALREADY ACTIVE
The parameter variable &1 is set to NCCFA, and the status of domain NCCFA is
checked. If you have an active cross-domain session with NCCFA, &STATUS is set
to ACT. If not, &STATUS is set to INACT. The &IF statement tests whether
&STATUS is set to ACT or INACT (for more information, see “&IF Control
Statement” on page 123).
If NCCFA is inactive, the command list starts it. If NCCFA is active, you receive
the following message:
DOMAIN NCCFA IS ALREADY ACTIVE
&SUBSTR
The &SUBSTR function returns the specified portion of an input variable by
parsing the variable, starting at position start for length characters. The syntax of
&SUBSTR is:
&SUBSTR
where:
length
The number of characters to parse, beginning with the specified start position.
If no length is specified, the parsing is from the start to the end of the variable.
start
Is the starting position of the parsing operation within the variable.
variable
Is the variable to be parsed.
&HOLD = ACF/VTAM
&FIRST = &SUBSTR &HOLD 1 3
&SECOND = &SUBSTR &HOLD 5 4
&THIRD = &SUBSTR &HOLD 6
The first line of the previous example sets the value of variable &HOLD to
ACF/VTAM. In the next line, &SUBSTR starts at the first character of &HOLD (the
letter A) and moves three characters to the right (to the character F). The letters
ACF become the value of the variable &FIRST. In the next line, &SUBSTR starts at
the fifth character of &HOLD (the letter V) and goes for a length of four (to the
character M). The letters VTAM are put into variable &SECOND. In the last line,
&SUBSTR starts at the sixth character of &HOLD (the character T) but does not
specify a length. &THIRD is therefore TAM, the value of &HOLD from the letter T
through the end of the variable (M). The starting positions are determined as
shown:
1 2 3 4 5 6 7 8
A C F / V T A M
Note: The first starting position is 1, the second is 2, and so on. Zero is not a valid
position. Because the largest variable value is 255 characters, it is not valid
to have a starting point greater than 255.
You do not have to specify a length. If the length is not specified, the remainder of
the string to the right beginning with the starting position becomes the substring.
NetView never pads substrings with blanks. If you specify a length that is too
long, NetView assumes no length was specified and uses the entire string
beginning at the starting position. If the length is 0, or the starting position is
beyond the variable length, the result of &SUBSTR is null.
Figure 45 shows how you can use a substring of the &APPLID control variable to
determine the name of the domain running the command list:
GETDOMID CLIST
&CONTROL ERR
* DETERMINE THE LENGTH OF THE APPL ID
&LENAPPL = &LENGTH &APPLID
* SUBTRACT 3 TO GET THE LENGTH OF THE DOMAIN ID
&LENAPPL = &LENAPPL - 3
* START AT COLUMN 1 OF NEW LENAPPL FOR LENGTH OF DOMAIN ID
* THE VALUE OF &DOMAIN WILL BE THE DOMAIN ID
&DOMAIN = &SUBSTR &APPLID 1 &LENAPPL
* &DOMAIN NOW CONTAINS THE DOMAIN ID
When using double-byte characters along with Roman characters (A–Z; a–z), the
&SUBSTR function adjusts the variable as follows:
Start byte = shift-out character
No adjustment
Start byte = shift-in character
Replace with blank
Start byte = first half of double-byte
Replace with blank and shift-out character
Start byte = second half of double-byte
Replace with shift-out character
Last byte = shift-out character
Replace with blank
Last byte = shift-in character
No adjustment
Last byte = first half of double-byte
Replace with shift-in character
Last byte = second half of double-byte
Replace with shift-in character and blank.
where:
v A, B, E, F, G are Latin characters.
v < (X'0E') represents the shift-out control character.
v > (X'0F') is the shift-in control character.
v D1, D2, D3 are double-byte characters.
Note: The DBCS delimiters are 1 byte long; the DBCS codes are 2 bytes long.
If the condition is true, the &THEN clause is processed. If the condition is false,
processing continues at the statement following the &IF control statement. The
syntax of the &IF control statement is:
&IF&THEN
where:
= or EQ
Equal
expression_1
Is any expression that can be used in an assignment statement. It can be a
constant, a variable, an arithmetic operation, or a built-in function. For more
information, see “Assignment Statements” on page 102.
expression_2
Is the second term of comparison. It follows the same rules as expression_1.
> or GT
Greater than
>= or GE
Greater than or equal
< or LT
Less than
<= or LE
Less than or equal
¬= or NE
Not equal
¬> or NG
Not greater than
¬< or NL
Not less than
Note: You can use either the symbol code or the 2-character letter code. Both
have the same meaning.
&THEN
Separates the comparison from the command list statement that is processed if
the condition is true. You must code &THEN in every &IF statement.
Note: Coding the ampersand (&) with THEN identifies the word as part of the
control statement.
statement
Is the command list statement that is processed if the comparison is true,
otherwise it is ignored. The statement can be any NetView command list
language statement.
Variables coded in the comparison expressions are replaced by their values before
the comparison is checked. You can use two single quotation marks with no space
('') to test whether a variable is null. For example, the comparison &1 = '' is true
when &1 is null.
In this example, the zero (0)&1 is evaluated as zero (0) because &1 is null.
Therefore, the expression 3 + 0 is compared to 7. If &1 was equal to 9, the
expression 3 + 09 would be compared to 7.
&GOTO
&GOTO -label
where:
-label
Identifies the target statement in this command list where processing
continues.
When the NetView program interprets the &GOTO statement, it searches the
command list for a statement starting with this same label. The NetView program
transfers control to that statement and continues the command list processing. The
statement identified by the label can be before or after the &GOTO statement.
You can code a variable for your label as long as the variable is replaced by a
value before the NetView program processes the &GOTO statement. See “Labels”
on page 94 for more information about labels.
You can use &EXIT with &IF to check the command list and exit if there is an
error. You can use &EXIT with &GOTO to control the flow of the command list.
The syntax of the &EXIT control statement is:
&EXIT
&EXIT
number
where:
number
Is an error return code. It can be equal to -1, 0, or any positive number up to
2147483647. To debug potential problems in nested command lists, code a
return code on &EXIT.
The return code you set on the &EXIT control statement is placed in the
&RETCODE control variable. The calling command list can test &RETCODE and
take action based on the return code. See “Command List Information” on page 40
for more information about &RETCODE.
You can define meanings for the positive numbers. If you code a nonzero return
code on the &EXIT statement, and if &CONTROL ERR is in effect, the command
list command that generated the nonzero return code is echoed on the panel.
When a command list returns a -1, that command list, and all command lists in the
nested chain, end. If you do not code a return code on &EXIT, or if the command
list ends when the last line is processed and there is no &EXIT statement, a zero
return code is set.
Figure 46 shows an example command list named STOPTAF that uses the
ENDSESS command to stop all terminal access facility sessions. The command list
checks for errors. To start the command list, enter STOPTAF or STOPTAF ALL. If
you forget what the command list does or forget what to enter, use STOPTAF ? to
get help.
STOPTAF CLIST
&CONTROL ERR
* IF USER ENTERS STOPTAF ?, GO TO HELP SECTION
&IF &1 EQ ? &THEN &GOTO -HELP
* IF NO PARAMETERS, GO TO COMMAND
&IF &1 EQ '' &THEN &GOTO -CMD
* IF PARAMETER IS ALL, GO TO COMMAND. ELSE PRINT ERROR MSG
&IF &1 NE ALL &THEN &GOTO -ERROR
-CMD
ENDSESS OPCTL,ALL
ENDSESS FLSCN,ALL
&EXIT
-ERROR
&WRITE YOU ENTERED: STOPTAF &PARMSTR WHICH IS NOT CORRECT
-HELP
&BEGWRITE -END
ENTER: STOPTAF TO STOP ALL TERMINAL ACCESS FACILITY SESSIONS
-END
&EXIT 4
If you enter STOPTAF or STOPTAF ALL, only the results of the two ENDSESS
commands are displayed.
If the trapped message satisfies the wait condition, processing of the waiting
command procedure resumes. If you do not suppress the message at this point, it
continues with the message flow. If you suppress the message, however, the
NetView program marks it for deletion. In this case, automation-table processing
does not occur and the NetView program does not display or log the message.
&WAIT and &PAUSE work differently. With &PAUSE, the command list does not
continue until the operator enters the GO command. Operands on the GO
command are used in the command list. However, because &WAIT causes the
command list to wait for a specific event or events, GO is used to resume the
command list only if the event never occurs. When a command list is in a wait
When the command list begins processing a &WAIT control statement, NetView
displays the letter W in the upper right corner of the panel if the panel is refreshed
because a message is received or the ENTER key is pressed. This W notifies the
operator that a command list process is in a wait state. Wait state means the
command list has halted its processing and is waiting for a specific message or
group of messages. When the specific message arrives, the control variables and
the parameter variables are set to their current values. The syntax of the &WAIT
control statement is:
&WAIT
&WAIT event=−label
'command'
where:
'command'
Is any command or command list that you can issue from the NetView
program. This command is optional. It is usually the command from which the
command list is waiting for messages. For example, if you want the command
list to wait for a successful session startup, the entire BGNSESS command is
coded between single quotation marks. Be sure to code command list
continuation characters before the event=-label pairs. The command is run as
soon as it is reached in the command list.
You can code one of the NetView timer commands, AT®, EVERY, or AFTER, in
the &WAIT statement. If the scheduled command is a command list, it cannot
run until either the current command list is complete or the STACK command
is entered.
event=-label
Is an event=-label pair. You can code as many of these pairs as you want on an
&WAIT statement, up to the limit of 255 characters. The event is usually a
message for which the command list is waiting. The event can be a trigger that
ends the wait state before the message arrives. The &WAIT statement causes
the NetView program to scan all messages sent to the operator. If a message
matches one of the events coded, the command list goes to the line with the
specified label and continues processing from the labeled statement. For more
information about the types of events that can satisfy an &WAIT, see “The
Event=-Label Pair” on page 129.
When the NetView program receives the message it is waiting for, the message is
displayed on the operator terminal, as are all NetView messages. However, in this
case, the message type is W unless the message satisfying the &WAIT originated
from a command list, in which case the message type remains C. If you do not
want the operator to see this message, see “Customizing the &WAIT Statement” on
page 135.
The NetView program checks only messages that are intended for the operator’s
screen. If you code exit routine DSIEX02A (output to the operator), the &WAIT
control statement might not set the message for matching. For example, if
DSIEX02A deletes the message, &WAIT does not get the message so a match is not
made. Because the operator does not receive the message, neither does the waiting
command list. Therefore, you should wait only for messages that are displayed on
the NetView console.
Notes:
1. When coding the &WAIT command control statement, it is important to code
an event=-label pair for message DSI210I and *NN. The DSI210I message is
returned when the command found in the command list is not authorized for
this operator, and the *NN event prevents waiting indefinitely for operator
intervention. The statements following labels should notify the operator of the
error and exit the command list.
2. The W signifying a wait state, if present, remains in the upper right corner of
the panel while this initial &WAIT command is processed. The W tells the
operator that NetView is still waiting for messages. If the operator enters GO
before this command or command list completes processing, the GO is rejected
with message DSI016I NOT IN PAUSE OR WAIT STATUS. When the command or
command list is complete, the GO is accepted. RESET ends a command list that
is in a wait state. If you enter the STACK command, the W does not remain in
the upper right corner of the panel.
3. You can code several event=-label pairs, but the first message or other condition
that matches one of the events stops the command list from waiting for more
messages. You can change this if you want to process several messages with
one &WAIT statement. See “Customizing the &WAIT Statement” on page 135.
The following are examples of some of the ways you can specify the
messages for which you want the command list to wait:
domainid.token
The event occurs when the NetView program receives any message
whose domain identifier matches the 1–5 character domainid and
whose first token matches token.
dom*.token
The event occurs when the NetView program receives any message
whose domain identifier matches the partial domain identifier
specified by dom* and whose first token matches token. For
example, NCCF*.DSI463I means the event occurs when a DSI463I
message is received from any domain with an identifier that starts
with NCCF (such as NCCFA or NCCFB).
*.token The event occurs when the NetView program receives any message
whose first token matches token. The message can be from any
domain.
token The event occurs when the NetView program receives any message
whose first token matches token. The message can be from any
domain.
tok* The event occurs when the NetView program receives any message
whose first token matches the partial token specified by tok*. For
example, DSI* means the event occurs when the NetView program
receives any message whose first token begins with DSI (such as
DSI463I or DSI386I).
* The event occurs when the NetView program receives any message
or other output. For example, if you code &CONTROL ALL in the
command list, every line of the command list is echoed on the
panel. These echoes satisfy the * condition, and depending on the
code in the command list, could cause a loop or other undesirable
results. Therefore, use the *=-label condition with caution.
&WAIT DOMAIN1.*HASP=-MSG1
&WAIT DOMAIN1.=HASP=-MSG1
&X = &CONCAT & HASP
&WAIT DOMAIN1.&X=-MSG1
Note: Messages associated with the command can be received before the
command returns a nonzero return code. If such a message is coded
on an event=-label pair, control is passed to the first statement whose
event has occurred.
For example, if you code the name of the &WAIT command on a
MSGID=-label pair, and you also code an *ERROR=-label pair, the NetView
program honors the MSGID=-label pair first because that event occurs first.
*nn This event occurs after nn seconds. If no other event occurs, the &WAIT
ends and control passes to the labeled statement. You can code a value
between 1 and 32767 seconds (9 hours, 6 minutes, 7 seconds). If you do not
code *nn and none of the events of the &WAIT are satisfied, &WAIT
continues until the operator enters a GO or RESET command.
*ENDWAIT
This event occurs when the operator or a command list issues a GO
command. If you do not code *ENDWAIT=-label, the GO command
continues processing with the statement following the &WAIT command.
Error Conditions
If an error condition occurs, the NetView program should be able to go to another
part of the command list and take appropriate action. Consider the types of errors
you can have and plan to handle them by coding *ERROR, *nn, and *ENDWAIT
events.
&WAIT IST*=-ALL,IST123I=-SPECIAL
When the NetView program receives IST123I, it goes to the label -ALL, not
-SPECIAL. You should code IST123I before IST*.
You can code as many events as required on one &WAIT control statement up to
255 characters. Remember to use continuation characters if the event pairs take up
more than one line. Code the message and domain identifiers in the order that you
want them processed. The NetView program scans the list from left to right until a
match is found.
Ending an &WAIT
An &WAIT statement can end in one of the following ways:
v The operator enters the GO command. Processing continues with the next
statement, unless *ENDWAIT is specified on the &WAIT statement. If
*ENDWAIT is specified, processing continues with the statement marked by the
label.
v The operator enters the RESET command. The command list and all of its nested
command lists end.
v Coding *ERROR on the &WAIT statement. If the command specified on the
&WAIT statement ends with an error, the command list continues processing at
the statement marked with the label. If you do not code *ERROR in this
situation, the &WAIT does not end until the operator enters GO or RESET.
v Coding *nn on the &WAIT statement. The command list continues processing at
the statement specified by the label if another event does not occur within nn
seconds.
v Receipt of a message matching an event=-label pair. The command list continues
processing with the statement marked with the label.
The GO, STACK, UNSTACK, and RESET commands affect the processing of
command lists in a wait state as follows:
GO Ends the wait.
If *ENDWAIT is coded, processing continues with the labeled statement.
STACK
Suspends command list processing and causes any commands that are
deferred to be processed. You can enter any command or command list for
normal processing while a command list is suspended. The &WAIT is not
suspended, and events are still matched as they occur. The command list
using &WAIT does not process messages as they occur, but, instead, after
the command list is given control again. The W does not remain in the
upper right corner of the NetView panel. The GO command is rejected
until the command list resumes processing.
UNSTACK
Resumes command list processing. The &WAIT resumes processing events
that were matched while the command list was suspended.
RESET
Ends a command list that is in a wait state, and all command lists related
to it by nesting.
The NetView program changes the values of the &1–&31 parameter variables to
reflect the text of the message. Each parameter variable is set to a token of the
message. Tokens are delimited by commas, apostrophes, or blanks. &1 is set to the
first token following the message identifier (the token used by the &MSGID control
variable). &2 is set to the next token to the right of &1, and so on up to a
maximum of 31 variables.
The following is an example of how the variables are set when the message
DSI008I SPAN1 NOT ACTIVE from domain DOM01 is intercepted by an &WAIT
statement:
&MSGORIGIN DOM01
&MSGID DSI008I
&MSGSTR SPAN1 NOT ACTIVE
&MSGCNT 3
&1 SPAN1
&2 NOT
&3 ACTIVE
&4–&31 NULL
Notes:
1. If the NetView program receives a multiline message, the control variables and
parameter variables are set according to the first nonblank line of the message.
Refer to the GETM commands in the NetView online help for information
about multiline messages.
2. If &1–&31 are given values when the command list runs, save the parameter
variables in user variables before calling the &WAIT control statement. This
procedure lets you use the original values after &WAIT changes them.
3. After issuing an &WAIT control statement, save the values of the control
variables in user variables before issuing another &WAIT control statement.
This procedure lets you use the values after another &WAIT changes them.
4. If you are using &WAIT CONTWAIT, be careful when using the control
variable &MSGID before the &WAIT has ended. If &MSGID is the first
character string on an &WRITE or &BEGWRITE, the output might be
suppressed or cause the command list to loop. If the &WAIT SUPPRESS option
is in effect, an &WRITE or &BEGWRITE with &MSGID as the first character
string of the text matches the MSGID=-label operand of the active &WAIT.
Therefore, the text of the &WRITE or &BEGWRITE is not sent to the operator’s
screen. If an &WAIT CONTINUE statement is encountered after a
MSGID=-label is matched, and there is no other statement to end the command
list or the &WAIT, the command list loops.
If the nested command list ends before the message satisfies the &WAIT, the
message is queued for the waiting command list. Without the ending of the
&WAIT or the waiting command list, the message queue continues to grow and
the NetView program can run out of storage.
This section describes how to customize the &WAIT statement for more flexibility.
&WAIT
DISPLAY ENDWAIT
&WAIT
SUPPRESS CONTWAIT
or
&WAIT
&WAIT CONTINUE
where:
DISPLAY
Indicates that the message the command list is waiting for is to be displayed at
the operator’s terminal upon arrival to the NetView program. DISPLAY is the
default value.
SUPPRESS
Indicates that any messages that satisfy an &WAIT are not displayed, logged,
or automated.
CONTWAIT
Indicates that the next &WAIT event=-label statement encountered waits for
additional events until the wait is ended. CONTWAIT enables one &WAIT
statement to process more than one event. This operand is useful when you
want to retrieve more than one message from a single command, such as a
LIST command.
ENDWAIT
Sets up processing for the next event=-label pair to be processed. ENDWAIT is
the default value. ENDWAIT indicates that the wait ends after the first event
that satisfies the &WAIT. Although ENDWAIT does not end a wait already in
process, operators can still use the GO command to end the wait. The RESET
command, which ends a wait, also ends the command list.
CONTINUE
Directs the command list to continue waiting for the next event that satisfies
the original &WAIT statement. CONTINUE is used only when &WAIT
CONTWAIT is specified prior to the &WAIT event=-label. If you want the wait
Note: At least one option must be specified. Defaults are not called if no option is
specified.
The operands of this format are optional and can be coded in any order. However,
they cannot be coded on the &WAIT event=-label statement. The &WAIT statement
does not put the command list into a wait state. Instead, it indicates how the
command list processes the next &WAIT event=-label control statement.
activate a nested command list, the default settings are in effect for that command
list unless an &WAIT statement is coded for the nested command list.
Note: Because &WAIT CONTWAIT queues NetView messages, you should also
code &WAIT CONTINUE to receive these queued messages. If you code
&WAIT CONTWAIT with SUPPRESS and end the wait, you might lose
some messages.
v If you specify &WAIT CONTWAIT, the receipt of the first event does not end
the &WAIT unless this event is specified as shown in “Ending &WAIT If
CONTWAIT Is in Effect” on page 137. The command list goes to the label
specified for the event and continues processing.
To complete this section of the command list, do one of the following:
– Continue the wait by coding &WAIT CONTINUE.
– Specify that the next event is the last event of this wait by coding &WAIT
ENDWAIT and then &WAIT CONTINUE.
– End the wait by coding the &WAIT ENDWAIT statement and GO
command in the command list.
– End the command list by coding &EXIT.
&CONTROL ERR
* ACTONE COMMAND LIST
* THIS COMMAND LIST ISSUES A VTAM "V NET,ACT" COMMAND, TRAPS ITS
* MESSAGES AND REFORMATS THEM.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IF THERE IS NO INPUT PARAMETER, ASK FOR ONE
&IF &1 = '' &THEN &GOTO -BADIN
* SAVE THE INPUT PARAMETER
&LU = &1
* END THE WAIT WITH THE FIRST MESSAGE AND DO NOT DISPLAY THE
* INPUT MESSAGE ON THE SCREEN
&WAIT ENDWAIT SUPPRESS
* ISSUE WAIT WITH THE COMMAND
&WAIT ’V NET,ACT,ID=&LU’,IST093I=-REFORM,*ERROR=-FAIL,+
IST105I=-FAIL,*ENDWAIT=-GOIN
-REFORM
* REFORMAT MESSAGE IST093I (SUCCESSFUL) AND WRITE TO THE SCREEN
* &1 IN THE FOLLOWING LINE IS NOT THE ORIGINAL &1
&ACTIV = &1
&WRITE VTAM MESSAGE IST093I WAS RECEIVED
-REFORM
&WRITE &ACTIV IS NOW ACTIVE
&GOTO -ENDALL
-FAIL
* REFORMAT MESSAGE IST105I (UNSUCCESSFUL) AND WRITE TO THE SCREEN
&WRITE &LU COULD NOT BE ACTIVATED
&GOTO -ENDALL
-GOIN
* IF "GO" ISSUED, INDICATE THAT MESSAGES HAVE NOT BEEN RECEIVED
&WRITE "GO" INPUT COMMAND LIST ACTONE -- &LU IS NOT ACTIVE NOW
&GOTO -ENDALL
-BADIN
&WRITE RE-CALL COMMAND LIST ACTONE WITH PARAMETER OF LU TO BE ACTIVATED
-ENDALL
&WRITE COMMAND LIST ACTONE COMPLETE
&EXIT
The ACTONE command list waits for one of the following messages:
IST093I modename ACTIVE
IST105I modename NODE NOW INACTIVE
Activate the command list by entering ACTONE and operand NODE1. The
operand is the name of the logical unit to be activated. This operand supplies the
value for parameter variable &1. Receipt of a message indicating success (IST093I)
or failure (IST105I) causes the wait to end because ENDWAIT was specified.
Processing continues at the specified label (-REFORM for IST093I, -FAIL for
IST105I). The awaited messages are not displayed because SUPPRESS was
specified, but any other messages are displayed.
ACTONE NODE1
IST097I VARY ACCEPTED
VTAM MESSAGE IST093I WAS RECEIVED
NODE1 IS NOW ACTIVE
COMMAND LIST ACTONE COMPLETE
Task global variables can be defined, referenced, and updated by any command list
running under a particular task. Task global variables can only be referenced by
command lists running under the task in which the variable was defined.
Common global variables enable definition of user variables that can be referenced
by command lists running under any NetView task that supports command list
processing.
Refer to the NetView online help for more information about the GLOBALV
command.
Notes:
1. Use caution when mixing &TGLOBAL, &CGLOBAL, or GLOBALV DEF with
the GLOBALV GET or PUT command. Using both methods to access global
variables of the same name within a single NetView command list language
command list is not recommended.
A direct set affects how subsequent copying and replacing are performed.
GLOBALV GETs and PUTs copy the value from one dictionary to the other.
&TGLOBAL and &CGLOBAL and GLOBALV DEFT or DEFC let you reference
the global variable and set it directly from that statement forward in the
command list. While both commands provide function, it is recommended that
you use one or the other within a single NetView command list.
2. When you create global variables, the variable can be 1 to 11 characters in
length. A-Z, 0–9, #, @, and $ are the only valid characters.
3. The value of the global variable can be 255 characters long. The maximum
number of double-byte characters between the shift-out (X'0E') and shift-in
(X'0F') control characters is 126.
4. You can give global variables a numerical value between -2147483647 and
2147483647. Numeric values outside these limits are treated as character strings.
On the definition statement, do not code an & with the global variable name
except where you want variable substitution performed. Substitution occurs for
any variable with an ampersand (&). Whenever you use the global variables
(except when defining them), you must append an & to the variable name, just as
you would for user variables.
You need two &s when referencing a global variable indirectly. See “Using
Parameter Variables in a Command List” on page 97 and “Variable Substitution
Order” on page 95 for more information about indirect referencing of variables.
&TGLOBAL
A task global variable can be referenced only by command lists that run under the
same task.
Use the &TGLOBAL control statement to define any variable as a task global
variable. The syntax of the &TGLOBAL control statement follows:
&TGLOBAL
&TGLOBAL variable
This statement defines the listed variables as task global variables. The value of
any variable defined by this statement is whatever was most recently assigned to it
by another command list running under the same task. If no value was assigned,
the value is undefined or null, and any attempt to retrieve the value causes a null
value to be returned. If you do not use the &TGLOBAL statement in each
command list before a variable is referenced, that variable defaults to a local user
variable.
&NAME = JOHN
&TGLOBAL ABC,&NAME
The first line consists of a local user variable set to the value JOHN. The second
line defines two task global variables as follows:
v ABC becomes task global variable &ABC. The value of &ABC is null because a
value was not defined.
v The value of &JOHN is null because a value has not been defined. This is an
example of indirect referencing of variables.
See “Extent of Variables When Using &TGLOBAL and &CGLOBAL” on page 145
for information about the interaction of task global variables with user variables
and common global variables.
If you specify more than one variable name on the &TGLOBAL statement, the
variable names must be delimited by commas or blanks.
&CGLOBAL
Use the &CGLOBAL control statement to define any variable as a common global
variable. The syntax of the &CGLOBAL control statement follows:
&CGLOBAL
&CGLOBAL variable
This statement defines the listed variables as common global variables. The value
of any variable defined by this statement is whatever was most recently assigned
to it by any other command list. If no value was assigned, the value is undefined
or null, and any attempt to retrieve the value causes a null value to be returned. If
you do not use the &CGLOBAL statement in each command list before a variable
is referenced, that variable defaults to a local user variable.
&NAME = JOHN
&CGLOBAL ABC,&NAME
The first line consists of a local user variable set to the value JOHN. The second
line defines two common global variables:
v ABC becomes common global variable &ABC. The value of &ABC is null
because a value is not defined.
v &NAME becomes common global variable &JOHN. Because &NAME has a
value of JOHN, the &NAME on this line gets substituted as JOHN. This defines
the common global variable &JOHN. The value of &JOHN is null because a
value is not defined.
Note: If you have more than one command list running under different tasks
accessing the same global variable, the last value that the variable is set to is
the value that is set by any command list changing the variable.
For example, a command list accesses a common global variable and then
before that command list updates the variable, another command list
running under a different task accesses the variable. If both command lists
update the variable, the variable assumes the value given to it by the
command list that updates it last.
If you specify more than one variable name on the &CGLOBAL statement, the
variable names must be delimited by commas or blanks.
You can use the NetView-supplied command lists UPDCGLOB and SETCGLOB to
update and set common global variables. Refer to the NetView online help for
information.
You can use common global variables to maintain accurate information about the
network regardless of operators logging on and off.
You can use common global variables to keep cumulative information from
unsolicited access method messages. For example, you can use notification of a
failing resource to recover the resource. With a global variable, you can maintain a
count of the number of retries to prevent a loop.
Figure 50. CLIST1 Command List to Define, Update, and Reference Task Global Variables
CLIST1 in Figure 50 defines a task global variable, SYSVAR1. The value of the task
global variable SYSVAR1 returns a null value until a value is assigned using the
assignment statement, &SYSVAR1 = 5. CLIST1 activates a nested command list
named UPDT1.
UPDT1 in Figure 51 on page 145 redefines the value stored in task global variable
&1. Task global variable &1 gets its original value from SYSVAR1, which was the
first (and only) variable passed to UPDT1 when it was called by CLIST1. Because
the NetView program scans variables from right to left, the &1 part of &&1 is
evaluated first, and the value of &1 is equal to the value of SYSVAR1. The value of
the task global variable is referenced as &SYSVAR1. The initial value of &SYSVAR1
is 5, and then &SYSVAR1 is incremented by 1 using the &&1 = &&1 + 1 statement.
(&SYSVAR1 = &SYSVAR1 + 1 after it is evaluated by the NetView program.)
The updated value is available as a task global variable &SYSVAR1 in CLIST1. The
&WRITE SYSVAR1 = &SYSVAR1 statement displays the updated value of the
&SYSVAR1 task global variable.
If a command list defines a common global variable after the task global variable is
defined and has the same name as a task global variable, the value of the task
global variable remains unchanged. However, this command list can no longer
access the value of the task global variable unless you redefine the variable using
&TGLOBAL.
If a command list defines a task global variable after the common global variable is
defined with the same name as a common global variable, the value of the
common global variable remains unchanged. However, this command list can no
longer access the value of the common global variable unless you redefine the
variable using &CGLOBAL.
GLOBVAR1, Figure 52 on page 146, illustrates the extent of user variables, task
global variables, and common global variables within individual command lists
and command lists running under different tasks. This command list gives you
examples of the following variable manipulations:
v Assigning values to user variables
v Defining task global variables
v Defining common global variables
v Setting values for common global variables
&CONTROL ERR
*** CLIST NAME: GLOBVAR1
*** ASSIGN VALUES TO SEVERAL USER VARIABLES AND PRINT THEIR VALUES
******************************************************************
&OPER = OPER1
&VTLV = VT33
&DOM1 = CNM01002
CLEAR
&BEGWRITE SUB -ENDLOCAL
FROM GLOBVAR1: AFTER LOCAL VARIABLES ASSIGNED
VARIABLE VARIABLE VARIABLE
TYPE NAME VALUE
======== ======== ========
LOCAL OPER &OPER (OPER1)
LOCAL VTLV &VTLV (VT33)
LOCAL DOM1 &DOM1 (CNM01002)
-ENDLOCAL
*
*** DEFINE TASK GLOBAL VARIABLES
********************************
&TGLOBAL OPER VTLV CNT
&BEGWRITE SUB -ENDTG1
FROM GLOBVAR1: AFTER TGLOBAL VARIABLES DEFINED
VARIABLE VARIABLE VARIABLE
TYPE NAME VALUE
======== ======== ========
LOCAL DOM1 &DOM1 (CNM01002)
TASK OPER &OPER (NULL)
TASK VTLV &VTLV (NULL)
TASK CNT &CNT (NULL)
*
*** ASSIGN VALUES TO THE TASK GLOBAL VARIABLES
**********************************************
&OPER = OPER2
&VTLV = VT33
&CNT = 3
&BEGWRITE SUB -ENDTG2
FROM GLOBVAR1: AFTER VALUES ASSIGNED TO TGLOBAL VARIABLES
VARIABLE VARIABLE VARIABLE
TYPE NAME VALUE
======== ======== ========
LOCAL DOM1 &DOM1 (CNM01002)
TASK OPER &OPER (OPER2)
TASK VTLV &VTLV (VT33)
TASK CNT &CNT (3)
-ENDTG2
*
*** DEFINE COMMON GLOBAL VARIABLES
**********************************
&CGLOBAL OPER VTLV VAL
&BEGWRITE SUB -ENDTG3
FROM GLOBVAR1: AFTER CGLOBAL VARIABLES DEFINED
VARIABLE VARIABLE VARIABLE
TYPE NAME VALUE
======== ======== ========
LOCAL DOM1 &DOM1 (CNM01002)
TASK CNT &CNT (3)
COMMON OPER &OPER (NULL)
COMMON VTLV &VTLV (NULL)
COMMON VAL &VAL (NULL)
*
*** ASSIGN VALUES TO COMMON GLOBAL VARIABLES
********************************************
&OPER = OPER3
&VTLV = VT32
&VAL = HEX
&BEGWRITE SUB -ENDTG4
FROM GLOBVAR1: AFTER CGLOBAL VARIABLES ASSIGNED
VARIABLE VARIABLE VARIABLE
TYPE NAME VALUE
======== ======== ========
LOCAL DOM1 &DOM1 (CNM01002)
TASK CNT &CNT (3)
COMMON OPER &OPER (OPER3)
COMMON VTLV &VTLV (VT32)
COMMON VAL &VAL (HEX)
-ENDTG3
*** CHANGE ONE COMMON GLOBAL VARIABLE BACK TO A TASK GLOBAL VARIABLE
********************************************************************
&TGLOBAL OPER
&BEGWRITE SUB -ENDTG5
FROM GLOBVAR1: AFTER FINAL TGLOBAL STATEMENT
VARIABLE VARIABLE VARIABLE
TYPE NAME VALUE
======== ======== ========
LOCAL DOM1 &DOM1 (CNM01002)
TASK CNT &CNT (3)
TASK OPER &OPER (OPER2)
COMMON VTLV &VTLV (VT32)
COMMON VAL &VAL (HEX)
NOTE THAT THE OPER NOW HAS THE VALUE OF THE TASK
GLOBAL VARIABLE OPER AGAIN AS THE MOST RECENT
DECLARATION STATEMENT DEFINED IT AS TASK GLOBAL.
-ENDTG5
GLOBALV Command
The GLOBALV command enables you to define, put, and get global variables in
NetView command list language command lists. The GLOBALV command also
enables you to save global variables in a VSAM database. You can restore saved
global variables if the NetView program is stopped and restarted, or erase (purge)
saved global variables from external storage. Global variables enable multiple
command procedures, regardless of their language, to share a common set of
values.
Refer to the NetView online help for more information on the GLOBALV
command.
For detailed information on the vector formats used by COS, refer to NetView/PC:
Application Programming.
Four NetView COS commands are used with NetView/PC for problem
determination:
LINKTEST
Requests that the COS test a given link or link segment
LINKDATA
Requests that the COS return device data for a given link or link segment
LINKPD
Requests problem determination analysis from the COS on a given link or
link segment
RUNCMD
Sends COS application commands to the COS applications from the
NetView program
Refer to the NetView online help for the syntax of the LINKTEST, LINKDATA,
LINKPD, and RUNCMD commands.
The COS commands are long-running commands that suspend the command list
when they are processed. The command list resumes when the COS command is
complete. While the command list is suspended, no other commands waiting on
the low-priority queue of the task running the command list are processed until
the command list completes. This ensures that commands on the low-priority
queue can be processed in order.
You cannot use the NetView command list language &WAIT control statement or
the REXX TRAP and WAIT functions with the COS commands. Use automation
table-driven command lists to trap messages generated from the COS commands,
with the exception of:
v LINKPD messages DSI533I, DSI534I, DSI535I, DSI536I, and DSI582I. These five
messages are set to values you can use in the form of control and parameter
variables. See “LINKPD Results” on page 151 for more information about
LINKPD results.
v Responses to RUNCMD with the CLISTVAR keyword. CLISTVAR causes the
responses to be stored in variables. See “RUNCMD Results” on page 152 for
more information about RUNCMD results.
Use the variable name without the ampersand for REXX command lists and the
variable name with the ampersand for NetView command list language command
lists.
DSIpprreeDT or &DSIpprreeDT
Specifies the type of data item ee for resource rr on path pp. Possible values
are:
v BIT STRING
v CHARACTER
v DECIMAL
v HEXADECIMAL
DSIpprreeDV or &DSIpprreeDV
Specifies the value of data item ee for resource rr on path pp.
The italicized letters in the variable names are replaced with the following values:
pp Path number (01)
rr Resource number (01-99)
ee Entry number (01-99)
LINKPD Results
Results from the LINKPD command are returned in messages that you can use in
a command list to automate the recovery of resources controlled by a COS, for
example, NetView/PC.
For more information about the NetView command list language control variables
&MSGCNT, &MSGID, &MSGORIGIN, &MSGSTR, and &MSGTYP see “Message
Processing Information Functions” on page 48. For more information about
parameter variables used in command lists written in the NetView command list
language, see “Parameter Variables” on page 96.
RUNCMD Results
If you use RUNCMD without the CLISTVAR keyword, responses from the COS
application that performed the RUNCMD are sent to the network operator’s
terminal, and a return code is set. See “Common Operations Services Return
Codes” on page 150 for a description of the return codes.
In NetView command list language, the return code is returned in the &RETCODE
variable.
If you use RUNCMD with the CLISTVAR keyword, the command results in the
following:
v A return code is set (RC or &RETCODE); see “Common Operations Services
Return Codes” on page 150 for a description of the return codes.
v If the command completes with a return code of 0, 24, or 28, the following
variables are set.
Note: Use the variable name without the ampersand for REXX command lists.
Use the variable name with the ampersand for NetView command list
language command lists.
DSIRUNCNT or &DSIRUNCNT
Contains the number of responses returned from the COS application.
The variable has a value in the range of 001–998.
DSIRUNxxx or &DSIRUNxxx
Contains the different responses from the COS application. The
responses are numbered from 001–998.
Note: The responses from the COS must be character data and cannot
be longer than 255 characters.
For example, if you used the following segment of REXX code to set up commands
for service points:
RCMD.1 = ’RUNCMD SP=NT000001,APPL=APPLNAME,QUERY ABC’
RCMD.2 = ’RUNCMD SP=NT000002,APPL=APPLNAME,QUERY ABC’
RCMD.3
. = ’RUNCMD SP=NT000003,APPL=APPLNAME,QUERY ABC’
.
.
RCMD.100 = ’RUNCMD SP=NT000100,APPL=APPLNAME,QUERY ABC’
RCMD.0 = 100
You can then use the following command to issue all 100 commands as fast as the
requests can be scheduled, without waiting for results. The NetView program then
waits up to 120 seconds (between messages) for results and places the messages in
stem RESULT.
’PIPE STEM RCMD. | NETVIEW | CORRWAIT 120 | STEM RESULT.’
Notice that this command does not wait 120 seconds after the last result (assuming
all 100 commands have completed). The NetView program counts the commands
processed and notes when the last response to each command has arrived. The
results in stem RESULT. are not necessarily in the same order as the commands in
stem RCMD. because some service points will respond faster than others. The
number of lines stored in RESULT. will be found in RESULT.0.
For more information about using NetView pipelines, refer to IBM Tivoli NetView
for z/OS Programming: Pipes.
The last column of the table indicates whether the corresponding REXX instruction
is a standard instruction provided by REXX or an instruction provided by the
NetView program.
Table 20. Comparison of REXX Functions and NetView Command List Language Control
Variables and Functions (continued)
REXX Described NetView REXX Function
Function on Control Variable Provided By
EVENT() 49 None NetView
FNDMBR(...) 46 None NetView
HCOPY() 82 &HCOPY NetView
HDRMTYPE() 49 &HDRMTYPE NetView
HIER(n) 63, 114 &HIER NetView
HMASPRID() 63 None NetView
HMBLKACT() 64 None NetView
HMCPLINK() 64 None NetView
HMEPNAU() 65 None NetView
HMEPNET() 65 None NetView
HMEPNETV() 66 None NetView
HMEVTYPE() 66 None NetView
HMFWDED() 67 None NetView
HMFWDSNA() 67 None NetView
HMGENCAU() 68 None NetView
HMONMSU() 68 None NetView
HMORIGIN() 69 None NetView
HMSECREC() 69 None NetView
HMSPECAU() 70 None NetView
HMUSRDAT() 71 None NetView
IFRAUGMT() 49 &IFRAUGMT NetView
IFRAUIND() 50 &IFRAUIND NetView
IFRAUIN3() 50 &IFRAUIN3 NetView
IFRAUI3X() 50 &IFRAUI3X NetView
IFRAUSDR() 50 &IFRAUSDR NetView
IFRAUSRB() 50 &IFRAUSRB NetView
IFRAUSB2() 50 &IFRAUSB2 NetView
IFRAUSRC() 51 &IFRAUSRC NetView
IFRAUSC2() 50 &IFRAUSC2 NetView
IFRAUTA1() 51 &IFRAUTA1 NetView
IFRAUWF1() 51 &IFRAUWF1 NetView
JOBNAME() 55 &JOBNAME NetView
JOBNUM() 55 &JOBNUM NetView
KEY() 55 &KEY NetView
LENGTH(...) 116 &LENGTH REXX
LINETYPE() 51 &LINETYPE NetView
LU() 82 &LU NetView
MCSFLAG() 56 &MCSFLAG NetView
Table 20. Comparison of REXX Functions and NetView Command List Language Control
Variables and Functions (continued)
REXX Described NetView REXX Function
Function on Control Variable Provided By
MSGASID() 56 &MSGASID NetView
MSGAUTH() 56 &MSGAUTH NetView
MSGCATTR() 56 &MSGCATTR NetView
MSGCMISC() 56 &MSGCMISC NetView
MSGCMLVL() 57 &MSGCMLVL NetView
MSGCMSGT() 57 &MSGCMSGT NetView
MSGCNT() 57 &MSGCNT NetView
MSGCOJBN() 57 &MSGCOJBN NetView
MSGCPROD() 57 &MSGCPROD NetView
MSGCSPLX() 58 &MSGCSPLX NetView
MSGCSYID() 58 &MSGCSYID NetView
MSGDOMFL() 58 &MSGDOMFL NetView
MSGGBGPA() 58 &MSGGBGPA NetView
MSGGDATE() 58 &MSGGDATE NetView
MSGGFGPA() 59 &MSGGFGPA NetView
MSGGMFLG() 59 &MSGGMFLG NetView
MSGGMID() 59 &MSGGMID NetView
MSGGSEQ() 59 &MSGGSEQ NetView
MSGGSYID() 59 &MSGGSYID NetView
MSGGTIME() 59 &MSGGTIME NetView
MSGID() 52 &MSGID NetView
| MSGITEM() 52 None NetView
MSGORIGN() 53 &MSGORIGIN NetView
MSGSRCNM() 60 &MSGSRCNM NetView
MSGSTR() 53 &MSGSTR NetView
MSGTOKEN() 60 &MSGTOKEN NetView
MSGTSTMP() 54 &MSGTSTMP NetView
MSGTYP() 60 &MSGTYP NetView
MSGVAR() 54 None NetView
MSGVAR(number) 54 &1 - &31 NetView
MSUSEG(...) 71, 117 &MSUSEG NetView
MVSLEVEL() 79 &MVSLEVEL NetView
NVCNT() 45 &NCCFCNT NetView
NVDELID() 54 &NVDELID NetView
NVID(n) 46 &NCCFID NetView
NVSTAT(name) 46 &NCCFSTAT NetView
NETID() 79 &NETID NetView
NETVIEW() 79 &NETVIEW NetView
Table 20. Comparison of REXX Functions and NetView Command List Language Control
Variables and Functions (continued)
REXX Described NetView REXX Function
Function on Control Variable Provided By
NETVIEW(’x’) 79 None NetView
OPID() 77 &OPID NetView
OPID(’x’) 77 None NetView
OPSYSTEM() 80 &OPSYSTEM NetView
PANEL() 80 None NetView
PARMCNT() 45 &PARMCNT NetView
ARG(1) 45 &PARMSTR REXX
PARTID() 80 &PARTID NetView
PRTY() 60 &PRTY NetView
REPLYID() 54 &REPLYID NetView
RC 45 &RETCODE REXX
ROUTCDE() 61 &ROUTCDE NetView
RXDEFENV() 82 &RXDEFENV NetView
RXDEFSTR() 82 &RXDEFSTR NetView
RXNUMENV() 82 &RXNUMENV NetView
RXOVRENV() 82 &RXOVRENV NetView
RXOVRSTR() 82 &RXOVRSTR NetView
SESSID() 54 &SESSID NetView
SMSGID() 61 &SMSGID NetView
STCKGMT() 80 &STCKGMT NetView
SUBSTR(...) 120 &SUBSTR REXX
SUBSYM(...) 40 None NetView
SUPPCHAR() 80 &SUPPCHAR NetView
SYSCONID() 61 &SYSCONID NetView
SYSID() 61 &SYSID NetView
SYSPLEX() 80 &SYSPLEX NetView
TASK() 80 &TASK NetView
TGLOBAL(name) 48, 142 &TGLOBAL NetView
TIME() 83 &TIME REXX
TOWER(...) 81 None NetView
TYPE() 81 None NetView
VTAM() 81 &VTAM NetView
VTCOMPID() 81 &VTCOMPID NetView
WEEKDAYN() 81 &WEEKDAYN NetView
WTOREPLY 61 &WTOREPLY NetView
Note: FLUSHQ, MSGREAD, TRAP, and WAIT can be used only in REXX
command lists.
When using the commands in a REXX command list, enclose in single quotation
marks the parts of the command on which you do not want variable substitution
to take place.
The tables show the name of the command list example, a brief description of its
function, and where to find the example in this book.
ACTAPPLS Example
/* *******************************************************************/
/* */
/* ACTAPPLS - REXX VERSION */
/* */
/* DISPLAY ONLY THE ACTIVE APPLS */
/* */
/* *******************************************************************/
TRACE E
SAY ’ACTIVE APPLICATIONS:’ /* Write the header */
SAY ’====================’
’TRAP SUPPRESS MESSAGES IST350I IST097I’ /* Wait on the display */
’D NET,APPLS’
’WAIT 60 SECONDS FOR MESSAGES’
DO WHILE EVENT() = ’M’
SELECT /* SELECT on all events */
WHEN EVENT() = ’M’ THEN
DO
’MSGREAD’
SELECT /* SELECT on message */
WHEN MSGID()=’IST350I’ THEN
CALL FIRST
OTHERWISE
CALL ALLELSE
END /* END - SELECT */
’WAIT CONTINUE’
END /* EVENT() = M do loop */
OTHERWISE
DO
’TRAP NO MESSAGES’
’FLUSHQ’
END
END /* END - SELECT */
END /* END - DO WHILE */
/* */
/* ALL NON-INFORMATIONAL MESSAGES GO HERE */
/* */
ALLELSE:
RETURN
/* */
/* THE MULTILINE WTO WITH THE APPL INFORMATION COMES HERE */
/* */
FIRST:
’GETMSIZE NUMLINES’ /* Determine the number of lines */
I = 0 /* Initialize line number counter*/
TOTALACT = 0 /* Initialize total active appls */
DO WHILE NUMLINES ¬= I /* DO for all lines */
DO CURR = 1 TO 3
IF S.CURR ¬= ’’ THEN /* Do we have a status? */
DO
IF S.CURR = ’ACTIV’ THEN /* Is the current APPL active? */
NUMACT = NUMACT + 1 /* Bump the number active count */
ELSE
DO
S.CURR = ’’ /* APPL not active, so blank out */
A.CURR = ’
END
END
ELSE
A.CURR = ’’ /* Not an APPL */
END /* END - DO CURR */
IF NUMACT ¬= 0 & (A.1 ¬= ’’ | A.2 ¬= ’’ | A.3 ¬= ’’) THEN
SAY STRIP(A.1 A.2 A.3,’L’)
TOTALACT = TOTALACT + NUMACT /* Bump the total active counter */
END /* END - DO WHILE */
ACTLU Example
CHKOPNUM Example
Figure 55 on page 166 is an example of a command list that uses the PARSE
instruction.
/**********************************************************************/
/* */
/* THE FOLLOWING REXX COMMAND LIST IS A FAIRLY SIMPLE EXAMPLE */
/* OF HOW SOME OF THE BASIC REXX FUNCTIONS AND NETVIEW-SPECIFIC */
/* FUNCTIONS CAN BE USED IN A COMMAND LIST. IT ILLUSTRATES THE USAGE*/
/* OF SUCH THINGS AS THE REXX ’PARSE’ INSTRUCTION, AND THE NETVIEW */
/* SUPPLIED ’MSGTRAP’, ’WAIT’, ’MSGREAD’, AND ’GLOBALV’ COMMANDS. */
/* */
/**********************************************************************/
/* */
/* COMMAND LIST NAME: CHKOPNUM */
/* */
/* THIS COMMAND LIST CAN BE USED PERIODICALLY TO CHECK THE */
/* NUMBER OF OPERATORS CURRENTLY LOGGED ON, AND WILL KEEP THE */
/* INFORMATION IN COMMON GLOBAL VARIABLES. THE INFORMATION */
/* COLLECTED CAN LATER BE RETRIEVED BY USING THE ’DISPLAY’ */
/* OPTION. */
/* */
/* INPUT: */
/* ’’ - WILL CHECK THE NUMBER OF OPERATORS LOGGED ON */
/* AND UPDATE APPROPRIATE COMMON GLOBAL VARIABLES */
/* ’DISPLAY’ - WILL ANALYZE THE VALUE IN THE COMMON GLOBAL */
/* VARIABLES AND DISPLAY THE RESULTS */
/* ANY OTHER */
/* INPUT - WILL DEFAULT TO ’’ */
/* */
/* USAGE EXAMPLE: */
/* 1. EXECUTE THE FOLLOWING TO CAUSE THE NUMBER OF */
/* OPERATORS TO BE CHECKED AT A CERTAIN TIME (COULD BE */
/* ANY TIME PERIOD); */
/* -> ’AT 08:00:00,CHKOPNUM’ */
/* 2. AT ANY TIME, EXECUTE THE FOLLOWING COMMAND TO DISPLAY */
/* THE RESULTS OF THE PREVIOUS EXECUTIONS: */
/* -> ’CHKOPNUM DISPLAY’ */
/* RESULTS WILL BE DISPLAYED ON YOUR TERMINAL */
/* */
/* CHANGE CODE DATE DESCRIPTION */
/* ----------- -------- ------------------------------------------ */
/* */
/**********************************************************************/
Figure 55. CHKOPNUM Example (Part 1 of 2)
SIGNAL ON ERROR
PARSE ARG OPTION
’GLOBALV GETC CHKOPTIMES, CHKOPNUM, CHKOPMAX’
IF OPTION = ’DISPLAY’ THEN DO;
IF CHKOPTIMES = ’’ THEN
SAY ’NUMBER OF OPERATORS HAS NEVER BEEN CHECKED’
ELSE DO;
SAY ’NUMBER OF OPERATORS HAS BEEN CHECKED ’CHKOPTIMES’ TIMES’
SAY ’AVERAGE NUMBER OF OPERATORS LOGGED ON
IS: ’CHKOPNUM/CHKOPTIMES
SAY ’MAXIMUM NUMBER OF OPERATORS LOGGED ON IS: ’CHKOPMAX
END;
EXIT 0;
END;
CUROPNUM = 0
’TRAP AND SUPPRESS MESSAGES OPERATOR:,END’
’LIST STATUS=OPS’
DO UNTIL MSGID()=’END’
’WAIT FOR MESSAGES’
’MSGREAD’
IF MSGID() = ’OPERATOR:’ THEN CUROPNUM = CUROPNUM +1
ELSE NOP
END
IF CHKOPTIMES = ’’ THEN CHKOPTIMES = 1
ELSE CHKOPTIMES = CHKOPTIMES + 1
IF CHKOPNUM = ’’ THEN CHKOPNUM = CUROPNUM
ELSE CHKOPNUM = CHKOPNUM + CUROPNUM
IF CHKOPMAX = ’’ THEN CHKOPMAX = CUROPNUM
ELSE IF CHKOPMAX < CUROPNUM THEN CHKOPMAX = CUROPNUM
’GLOBALV PUTC CHKOPTIMES, CHKOPNUM, CHKOPMAX’
EXIT 0;
ERROR: SAY ’ERROR OCCURRED. RETURN CODE = ’ RC
EXIT -1;
CHKRSTAT Example
Figure 56 on page 168 is an example of a command list that uses the INTERPRET
instruction.
/**********************************************************************/
/* */
/* THE FOLLOWING REXX COMMAND LIST IS MORE COMPLEX THAN CHKOPNUM. */
/* IT ILLUSTRATES USAGE OF SUCH THINGS AS THE REXX ’INTERPRET’ */
/* INSTRUCTION, AND THE NETVIEW ’WAIT’ (FOR MESSAGES AND TIME), */
/* AND THE ’GETMLINE’ COMMAND (FOR MULTILINE MESSAGES) */
/* */
/**********************************************************************/
/* */
/* COMMAND LIST NAME: CHKRSTAT */
/* */
/* THIS COMMAND LIST CHECKS WHETHER A SPECIFIED RESOURCE */
/* IS ACTIVE, AND INCREMENTS A COMMON GLOBAL VARIABLE THAT */
/* REFLECTS THE NUMBER OF TIMES IT WAS IN THAT STATE. THIS */
/* COMMAND LIST SHOULD BE SCHEDULED TO RUN UNDER AN AUTOTASK */
/* AT REGULAR INTERVALS. */
/* */
/* INPUT PARAMETERS: */
/* RESNAME - NAME OF RESOURCE TO CHECK STATUS OF */
/* */
/* CHANGE CODE DATE DESCRIPTION */
/* ----------- -------- ------------------------------------------ */
/* */
/**********************************************************************/
SIGNAL ON ERROR /* SIGNAL IF ERROR OCCURS */
PARSE UPPER ARG RESNAME /* GET INPUT, IF ANY */
/* IF MESSAGE DID NOT ARRIVE, THEN GIVE ERROR MESSAGE AND EXIT */
IF EVENT() ¬= ’M’ THEN DO
SAY ’ NO RESPONSE FROM VTAM - RESOURCE COUNT NOT UPDATED ’
EXIT 99
END
/* READ MESSAGE. IF IT IS IST097I, ISSUE WAIT AGAIN, AND THE NEXT */
/* MESSAGE READ SHOULD BE IST075I, WHICH HAS THE STATUS INFO */
’MSGREAD’
IF MSGID() = ’IST097I’ THEN DO;
’WAIT CONTINUE’
’MSGREAD’
/* IF THE MESSAGE IS NOT IST075I, DO NOTHING, AND THE STATUS WILL */
/* DEFAULT TO INACTIVE. IF IT IS IST075I, GET THE 2ND LINE OF THE */
/* MULTI-LINE MESSAGE AND GET THE CURRENT STATE FROM THAT LINE */
IF MSGID() = ’IST075I’ THEN DO
’GETMLINE STATLINE ’ 2
/* IF STRING CONTAINS IST486I THEN PARSE OUT RESOURCE STATUS */
IF INDEX(STATLINE,’IST486I’) >0 THEN
PARSE VALUE STATLINE WITH MSGTXT1 ’STATUS=’ RESSTATE .
END
END
DSPRSTAT Example
Figure 57 on page 170 is an example of a command list that uses the same type of
function as Figure 56 on page 168.
/**********************************************************************/
/* */
/* THE FOLLOWING REXX COMMAND LIST GOES ALONG WITH THE PREVIOUS */
/* EXAMPLE (CHKRSTAT), AND SHOWS MANY OF THE SAME TYPE OF FUNCTIONS */
/* AS THE PREVIOUS EXAMPLE. */
/* */
/* THIS COMMAND LIST COULD BE USED BY ANY OST OPERATOR TO DISPLAY */
/* THE RESULTS OF SEVERAL EXECUTIONS OF THE CHKRSTAT COMMAND LIST */
/* FOR A SPECIFIC RESOURCE. IT COULD BE USED AS AN AID IN */
/* DETERMINING HOW OFTEN A RESOURCE IS ACTIVE, BASED ON THE INTERVALS*/
/* IN WHICH IT WAS CHECKED BY THE CHKRSTAT COMMAND LIST */
/* */
/**********************************************************************/
/* */
/* COMMAND LIST NAME: DSPRSTAT */
/* */
/* THIS COMMAND LIST CAN BE USED TO DISPLAY HOW OFTEN A RESOURCE */
/* WAS ACTIVE VS. NOT ACTIVE, AS RECORDED BY THE CHKRSTAT COMMAND */
/* LIST */
/* */
/* INPUT PARAMETERS: NONE */
/* */
/* CHANGE CODE DATE DESCRIPTION */
/* ----------- -------- ------------------------------------------ */
/* */
/**********************************************************************/
PARSE UPPER ARG RESNAME /* GET INPUT, IF ANY */
GETCG Example
/****************************************************************/
/* GETCG COMMAND LIST - REXX VERSION */
/* */
/* GETCG COMMAND LIST GETS THE VALUE OF A COMMON GLOBAL */
/* VARIABLE AND DISPLAYS IT TO THE REQUESTING TASK */
/****************************************************************/
TRACE E
’GLOBALV GETC’ MSGVAR(1)
’MESSAGE 309I GETCG COMMON GLOBAL VARIABLE’ MSGVAR(1) ,
’HAS VALUE ’ VALUE(MSGVAR(1))
EXIT
GREETING Example
/**********************************************************************/
/* */
/* GREETING - SHOW SIMPLE EXAMPLE OF WAITING AND TRAPPING */
/* USING THE DATE COMMAND */
/* */
/* NOTE: WHEN DATE IS ENTERED, THE FOLLOWING IS RETURNED: */
/* */
/* CNM359I DATE : TIME = HH:MM DATE = MM/DD/YY */
/**********************************************************************/
’TRAP AND SUPPRESS ONLY MESSAGES CNM359I ’ /* TRAP DATE MESSAGE */
’DATE’ /* ISSUE COMMAND */
’WAIT 10 SECONDS FOR MESSAGES’ /* WAIT FOR ANSWER */
SELECT /* RESULT IS BACK, PROCESS IT... */
WHEN (EVENT()=’M’) THEN /* DID WE GET A MESSAGE? */
DO /* YES... */
’MSGREAD’ /* ... READ IT IN */
HOUR=SUBSTR(MSGVAR(5),1,2) /* ... PARSE OUT THE HOUR */
SELECT /* GIVE APPROPRIATE GREETING... */
WHEN (HOUR<12) THEN /* ...BEFORE NOON? */
SAY ’GOOD MORNING’
WHEN (HOUR<18) THEN /* ...BEFORE SIX? */
SAY ’GOOD AFTERNOON’
OTHERWISE /* ...MUST BE NIGHT */
SAY ’GOOD EVENING’
END /* OF SELECT */
END /* OF DO */
WHEN (EVENT()=’E’) THEN /* DID WE GET AN ERROR? */
SAY ’ERROR OCCURRED WAITING FOR DATE COMMAND RESPONSE’
WHEN (EVENT()=’T’) THEN /* DID WE GET A TIME-OUT? */
SAY ’NO MESSAGE RETURNED FROM DATE COMMAND’
OTHERWISE
END /* OF SELECT */
EXIT
LISTVAR Example
/**********************************************************************/
/* */
/* THE LISTVAR COMMAND LIST WRITTEN IN REXX */
/* */
/**********************************************************************/
SELECT
WHEN MSGVAR(1)=’?’ THEN /* HELP REQUESTED ? */
’HELP LISTVAR’ /* GO GET HELP */
WHEN MSGVAR(1)¬=’’ THEN /* ANY PARMS SPECIFIED ? */
’MESSAGE 306E,LISTVAR’ MSGVAR(1) /* NO PARMS ALLOWED */
OTHERWISE /* ALL OK, LIST OUT VARIABLES*/
DO
MYSYS = SUBSTR(OPSYSTEM(),1,3)
SAY "CNM353I LISTVAR : ’OPSYSTEM’ = "OPSYSTEM()
IF MYSYS = ’VSE’ THEN
SAY "CNM353I LISTVAR : ’CURPART’ = "CURPART()
IF MYSYS = ’MVS’ THEN
SAY "CNM353I LISTVAR : ’MVSLEVEL’ = "MVSLEVEL()
IF MYSYS = ’MVS’ THEN
SAY "CNM353I LISTVAR : ’CURSYS’ = "CURSYS()
SAY "CNM353I LISTVAR : ’VTAMLVL’ = "VTAM()
SAY "CNM353I LISTVAR : ’VTCOMPID’ = "VTCOMPID()
TEMP = NETVIEW()
IF TEMP = ’NV33’ THEN TEMP = ’Tivoli V1R3’
SAY "CNM353I LISTVAR : ’NETVIEW’ = "TEMP
SAY "CNM353I LISTVAR : ’NETVIEW’ = "NETVIEW()
SAY "CNM353I LISTVAR : ’NETID’ = "NETID()
SAY "CNM353I LISTVAR : ’DOMAIN’ = "DOMAIN()
SAY "CNM353I LISTVAR : ’APPLID’ = "APPLID()
SAY "CNM353I LISTVAR : ’OPID’ = "OPID()
SAY "CNM353I LISTVAR : ’LU’ = "LU()
SAY "CNM353I LISTVAR : ’TASK’ = "TASK()
SAY "CNM353I LISTVAR : ’NVCNT’ = "NVCNT()
SAY "CNM353I LISTVAR : ’HCOPY’ = "HCOPY()
IF MYSYS = ’MVS’ THEN
SAY "CNM353I LISTVAR : ’CURCONID’ = "CURCONID()
IF MYSYS = ’MVS’ &AUTOTASK() = ’1’ THEN
SAY "CNM353I LISTVAR : ’AUTCONID’ = "AUTCONID()
IF VTAM() = ’’ THEN /* IS VTAM ACTIVE ? */
SAY ’CNM386I LISTVAR : VTAM IS NOT ACTIVE AT THIS TIME’
END /* OF THE LIST VARIABLES */
END /* OF SELECT */
RETURN /* RETURN TO CALLER */
EXIT
PRINT Example
Figure 61 on page 173 is an example of a command list used for printing a data
set.
/**********************************************************************/
/* PRINT COMMAND LIST */
/* ------------------ */
/* */
/* FUNCTION: THIS COMMAND LIST PRINTS MEMBERS OF A DATA SET TO A */
/* SYSTEM PRINT FILE. */
/* */
/* INPUT PARMS: DATASETNAME = FULLY QUALIFIED DATA SET NAME */
/* (INCLUDING MEMBER NAME) TO DISPLAY AT THE TERMINAL. */
/* */
/* OUTPUT: A SYSTEM PRINT FILE. */
/**********************************************************************/
SIGNAL ON ERROR /* SIGNAL IF ERROR OCCURS*/
ARG DATASETNAME /* PARSE CLIST INPUT */
IF DATASETNAME=’’ | PARMCNT() > 1 THEN /* NO CLIST INPUT ? */
DO /* NAME NOT SPECIFIED */
SAY ’INCORRECT SYNTAX USED.’ /* ISSUE ERROR MSG */
SAY ’CORRECT SYNTAX IS : ’ /* ISSUE HELP MSG */
SAY ’ PRINT DATASET.NAME(MEMBER) ’ /* ISSUE HELP MSG */
RC=24 /* SET RETURN CODE */
END /* NAME NOT SPECIFIED */
ELSE /* CORRECT NAME/SYNTAX */
DO /* NAME WAS SPECIFIED */
’TRAP DISPLAY ONLY MESSAGES *’ /* TRAP/SUPPRESS MSGS */
’ALLOCATE SYSOUT(A) FREE RECFM(FB) ’, /* ALLOC/CONNECT SYSTEM */
’LRECL(80) BLKSIZE(4000)’ /* ... PRINTER FOR USAGE */
’WAIT FOR MESSAGES’ /* WAIT FOR RESULTS */
’MSGREAD’ /* READ A MESSAGE IN */
IF (MSGID()¬=’CNM272I’) THEN /* IS MSG CNM272I ? */
DO /* ¬ CNM272I MSG */
SAY MSGID() MSGSTR() /* DISPLAY MESSAGE */
END /* ¬ CNM272I MSG */
ELSE /* MSG IS CNM272I */
DO /* PROCESS 1ST CNM272I */
DDNAMEO = MSGVAR(1) /* SAVE OUTPUT DDNAME */
’TRAP AND DISPLAY ONLY MESSAGES *’ /* TRAP/SUPPRESS MSGS */
’ALLOCATE DA(’DATASETNAME’) SHR FREE’/* ALLOC/CONNECT FILE */
’WAIT FOR MESSAGES’ /* WAIT FOR MESSAGES */
’MSGREAD’ /* READ A MESSAGE IN */
’TRAP NO MESSAGES’ /* DISABLE TRAP MSGS */
IF (MSGID()¬=’CNM272I’) THEN /* IS MSG CNM272I ? */
DO /* ¬ CNM272I MSG*/
SAY MSGID() MSGSTR() /* DISPLAY MESSAGE */
END /* ¬ CNM272I MSG*/
ELSE /* MSG IS CNM272I */
DO /* PROCESS 2ND CNM272I */
DDNAMEI = MSGVAR(1) /* SAVE INPUT DDNAME */
ADDRESS MVS ’EXECIO 1 DISKR ’DDNAMEI /* READ 1ST LINE */
DO WHILE RC=0 /* WHILE RC = 0 */
ADDRESS MVS ’EXECIO 1 DISKW ’DDNAMEO /* WRITE LINE OUT */
ADDRESS MVS ’EXECIO 1 DISKR ’DDNAMEI /* READ NEXT LINE */
END /* WHILE RC = 0 */
/* PUT OUT COMPLETE MSG */
’MESSAGE 309I PRINT CLIST IS NOW FINISHED’
END /* PROCESS 2ND CNM272I */
END /* PROCESS 1ST CNM272I */
END /* NAME WAS SPECIFIED */
TYPE Example
Figure 62 is an example of a command list used to display the members of a data
set.
/**********************************************************************/
/* TYPE COMMAND LIST */
/* ----------------- */
/* */
/* FUNCTION: THIS COMMAND LIST DISPLAYS MEMBERS OF A DATA SET AT THE */
/* (INVOKING) USER’S NETVIEW TERMINAL ONE LINE AT A TIME. */
/* */
/* INPUT PARMS: DATASETNAME = FULLY QUALIFIED DATA SET NAME */
/* (INCLUDING MEMBER NAME) TO DISPLAY AT THE TERMINAL. */
/* */
/* OUTPUT: LINE = EACH LINE WITHIN THE MEMBER SPECIFIED BY THE USER. */
/**********************************************************************/
SIGNAL ON ERROR /* SIGNAL IF ERROR OCCURS*/
ARG DATASETNAME /* PARSE CLIST INPUT */
IF DATASETNAME=’’ | PARMCNT() > 1 THEN /* NO CLIST INPUT ? */
DO /* NAME NOT SPECIFIED */
SAY ’INCORRECT SYNTAX USED.’ /* ISSUE ERROR MSG */
SAY ’CORRECT SYNTAX IS : ’ /* ISSUE HELP MSG */
SAY ’ TYPE DATASET.NAME(MEMBER) ’ /* ISSUE HELP MSG */
RC=24 /* SET RETURN CODE */
END /* NAME NOT SPECIFIED */
ELSE /* CORRECT NAME/SYNTAX */
DO /* NAME WAS SPECIFIED */
’TRAP AND SUPPRESS ONLY MESSAGES *’ /* TRAP/SUPPRESS MSGS */
’ALLOCATE DA(’DATASETNAME’) SHR FREE’ /* ALLOC/CONNECT FILE */
’WAIT FOR MESSAGES’ /* WAIT FOR MESSAGES */
’MSGREAD’ /* READ A MESSAGE IN */
’TRAP NO MESSAGES’ /* DISABLE TRAP MSGS */
IF (MSGID()¬=’CNM272I’) THEN /* IS MSG CNM272I ? */
DO /* ¬ CNM272I MSG */
SAY MSGID() MSGSTR() /* DISPLAY MESSAGE */
END /* ¬ CNM272I MSG */
ELSE /* MSG IS CNM272I */
DO /* PROCESS CNM272I MSG */
DDNAME = MSGVAR(1) /* SAVE DYNAMIC DDNAME */
ADDRESS MVS ’EXECIO 1 DISKR ’DDNAME /* PUT 1ST LINE ON STACK */
DO WHILE RC=0 /* WHILE RC = 0 */
PULL RECORD /* PULL LINE FROM STACK */
SAY SUBSTR(RECORD,1,68) /* DISPLAY LINE TO USER */
/* PUT NEXT LINE ON STACK*/
ADDRESS MVS ’EXECIO 1 DISKR ’DDNAME
END /* WHILE RC = 0 */
/* PUT OUT COMPLETE MSG */
’MESSAGE 309I TYPE CLIST IS NOW FINISHED’
END /* PROCESS CNM272I MSG */
END /* NAME WAS SPECIFIED */
RETURN /* RETURN TO CALLER/EXIT */
ERROR: SAY ’ERROR OCCURRED. RETURN CODE IS ’ RC
EXIT -1; /* END COMMAND LIST FOR ERROR*/
TYPEIT Example
Figure 63 on page 175 is an example of a command list that does essentially the
same thing as the example in Figure 62, but closes the data set in case of error.
Additional support for the NetView for z/OS product is available at the following
locations:
v At the NetView for z/OS Web site at
http://www.ibm.com/software/tivoli/products/netview-zos/. Under Related
links, click Other online sources. The page displayed contains a list of
newsgroups, forums, and bulletin boards.
v Through the NetView user group on Yahoo at
http://groups.yahoo.com/group/NetView/. This support is for NetView for
z/OS customers only, and registration is required. This forum is monitored by
NetView developers who answer questions and provide guidance. When a
problem with the code is found, you are asked to open an official problem
management record (PMR) to obtain resolution.
An index is provided for searching the Tivoli NetView for z/OS library. If you
have Adobe Acrobat on your system, you can use the Search command to locate
specific text in the library. For more information about using the index to search
the library, see the online help for Acrobat.
To search multiple Internet resources for your product, use the Web search topic in
your information center. In the navigation frame, click Troubleshooting and
support Searching knowledge bases and select Web search. From this topic, you
can search a variety of resources, including the following:
v IBM technotes
v IBM downloads
v IBM Redbooks™
Obtaining fixes
A product fix might be available to resolve your problem. To determine what fixes
are available for your IBM software product, follow these steps:
1. Go to the IBM Software Support Web site at
http://www.ibm.com/software/support
2. Under Product support pages A to Z, click I. This opens a software product
list.
3. In the software product list, click IBM Tivoli NetView for z/OS. This opens the
IBM Tivoli NetView for z/OS support site.
4. Under Self help, under Solve a problem, click APARs to go to a list of fixes,
fix packs, and other service updates for Tivoli NetView for z/OS.
5. Click the name of a fix to read the description and optionally download the fix.
You can also search for a specific fix; for tips on refining your search, click
Search tips.
For more information about the types of fixes that are available, see the IBM
Software Support Handbook at
http://techsupport.services.ibm.com/guides/handbook.html.
Before contacting IBM Software Support, your company must have an active IBM
software maintenance contract, and you must be authorized to submit problems to
IBM. The type of software maintenance contract that you need depends on the
type of product you have:
v For IBM distributed software products (including, but not limited to, Tivoli,
Lotus®, and Rational® products, as well as DB2® and WebSphere® products that
run on Windows or UNIX operating systems), enroll in Passport Advantage® in
one of the following ways:
Online
Go to the Passport Advantage Web site at
http://www.lotus.com/services/passport.nsf/
WebDocs/Passport_Advantage_Home and click How to Enroll.
By phone
For the phone number to call in your country, go to the IBM Software
Support Web site at
http://techsupport.services.ibm.com/guides/contacts.html and click the
name of your geographic region.
v For customers with Subscription and Support (S & S) contracts, go to the
Software Service Request Web site at
https://techsupport.services.ibm.com/ssr/login.
v For customers with IBMLink™, CATIA, Linux, System/390®, iSeries™, pSeries®,
zSeries®, and other support agreements, go to the IBM Support Line Web site at
http://www.ibm.com/services/us/index.wss/so/its/a1000030/dt006.
v For IBM eServer™ software products (including, but not limited to, DB2 and
WebSphere products that run in zSeries, pSeries, and iSeries environments), you
can purchase a software maintenance agreement by working directly with an
IBM sales representative or an IBM Business Partner. For more information
about support for eServer software products, go to the IBM Technical Support
Advantage Web site at http://www.ibm.com/servers/eserver/techsupport.html.
If you are not sure what type of software maintenance contract you need, call
1-800-IBMSERV (1-800-426-7378) in the United States. From other countries, go to
the contacts page of the IBM Software Support Handbook on the Web at
http://techsupport.services.ibm.com/guides/contacts.html and click the name of
your geographic region for phone numbers of people who provide support for
your location.
Submitting problems
You can submit your problem to IBM Software Support in one of two ways:
Online
Click Submit and track problems on the IBM Software Support site at
http://www.ibm.com/software/support/probsub.html. Type your
information into the appropriate problem submission form.
By phone
For the phone number to call in your country, go to the contacts page of
the IBM Software Support Handbook at
http://techsupport.services.ibm.com/guides/contacts.html and click the
name of your geographic region.
If the problem you submit is for a software defect or for missing or inaccurate
documentation, IBM Software Support creates an Authorized Program Analysis
Report (APAR). The APAR describes the problem in detail. Whenever possible,
IBM Software Support provides a workaround for you to implement until the
APAR is resolved and a fix is delivered. IBM publishes resolved APARs on the
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you
any license to these patents. You can send license inquiries, in writing, to:
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
sites. The materials at those Web sites are not part of the materials for this IBM
product and use of those Web sites is at your own risk.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
programs and other programs (including this one) and (ii) the mutual use of the
information which has been exchanged, should contact:
IBM Corporation
2Z4A/101
11400 Burnet Road
Austin, TX 78758 U.S.A.
The licensed program described in this document and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement or any equivalent agreement
between us.
COPYRIGHT LICENSE:
Each copy or any portion of these sample programs or any derivative work, must
include a copyright notice as follows:
© (your company name) (year). Portions of this code are derived from IBM Corp.
Sample Programs. © Copyright IBM Corp. _enter the year or years_. All rights
reserved.
Programming Interfaces
Trademarks
IBM, the IBM logo, Advanced Peer-to-Peer Networking, AIX, BookManager, Candle
Management Server, CandleNet Portal, CICS, DB2, developerWorks, eServer,
IBMLink, IMS, iSeries, Lotus, MVS, MVS/DFP, MVS/ESA, MVS/XA, NetView,
Passport Advantage, pSeries, RACF, Rational, Redbooks, S/390, SAA, System/390,
Tivoli, Tivoli Enterprise, Tivoli Enterprise Console, VM/ESA, VSE/ESA, VTAM,
WebSphere, z/OS, z/VM, and zSeries are trademarks or registered trademarks of
International Business Machines Corporation in the United States, other countries,
or both.
Intel and the Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino
logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or
registered trademarks of Intel Corporation or its subsidiaries in the United States
and other countries.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Other company, product, and service names may be trademarks or service marks
of others.
Notices 185
186 Programming: REXX and the NetView Command List Language
Index
Special characters &MSGCSPLX control variable 58
&MSGCSYID control variable 58
/*%DATA directive 20 &MSGDOMFL control variable 58
/*%LOGIC directive 20 &MSGGBGPA control variable 58
&1 - &31 parameter variables 134 &MSGGDATE control variable 58
&ACTIONDL control variable 49 &MSGGFGPA control variable 59
&ACTIONMG control variable 49 &MSGGMFLG control variable 59
&APPLID control variable 78 &MSGGMID control variable 59
&AREAID control variable 55 &MSGGSEQ control variable 59
&ASID control variable 78 &MSGGSYID control variable 59
&ATTENDED control variable 78 &MSGGTIME control variable 59
&ATTNID control variable 49 &MSGID control variable 52
&AUTCONID control variable 78 &MSGITEM control variable 52
&AUTOTASK control variable 78 &MSGORIGIN control variable 53
&AUTOTOKE control variable 55 &MSGSRCNM control variable 60
&BEGWRITE control statement 107 &MSGSTR control variable 53
&BITAND built-in function 111 &MSGTOKEN control variable 60
&BITOR built-in function 112 &MSGTSTMP control variable 54
&BITXOR built-in function 113 &MSGTYP control variable 60
&CART control variable 55 &MSUSEG built-in function 117
&CGLOBAL control statement 143 &MVSLEVEL control variable 79
&CONCAT built-in function 113 &MVSRTAIN variable 54
&CONTROL control statement 104 &NCCFCNT control variable 45
&CURCONID control variable 78 &NCCFID built-in function 46, 118
&CURSYS control variable 78 &NCCFSTAT built-in function 46, 119
&DATE control variable 83 &NETVIEW control variable 79
&DESC control variable 55 &NVDELID control variable 54
&DISC control variable 79 &OPID control variable 77
&DISTAUTO control variable 79 &OPSYSTEM control variable 80
&DOMAIN control variable 79 &PARMCNT control variable 45
&EXIT control statement 125 &PARMSTR control variable 45
&GOTO control statement 125 &PARTID control variable 80
&HCOPY control variable 82 &PAUSE control statement 108
&HDRMTYPE control variable 49 &PRTY control variable 60
&IF control statement 123 &REPLYID control variable 54
&IFRAUGMT control variable 49 &RETCODE control variable 45
&IFRAUI3X control variable 50 &RXDEFENV control variable 82
&IFRAUIN3 control variable 50 &RXDEFSTR control variable 82
&IFRAUIND control variable 50 &RXNUMENV control variable 82
&IFRAUSB2 control variable 50 &RXOVRENV control variable 82
&IFRAUSC2 control variable 50 &RXOVRSTR control variable 82
&IFRAUSDR control variable 50 &SESSID control variable 54
&IFRAUSRB control variable 50 &SMSGID control variable 61
&IFRAUSRC control variable 51 &STCKGMT control variable 80
&IFRAUTA1 control variable 51 &SUBSTR built-in function 120
&IFRAUWF1 control variable 51 &SUPPCHAR control variable 80
&JOBNAME control variable 55 &SYSCONID control variable 61
&JOBNUM control variable 55 &SYSID control variable 61
&KEY control variable 55 &SYSPLEX control variable 80
&LENGTH built-in function 116 &TASK control variable 80
&LINETYPE control variable 51 &TGLOBAL control statement 142
&LU control variable 82 &THEN clause, &IF control statement 124
&MCSFLAG control variable 56 &TIME control variable 83
&MSGASID control variable 56 &VTAM control variable 81
&MSGAUTH control variable 56 &VTCOMPID control variable 81
&MSGCATTR control variable 56 &WAIT control statement 127
&MSGCMISC control variable 56 &WEEKDAYN control variable 81
&MSGCMLVL control variable 57 &WRITE control statement 105
&MSGCMSGT control variable 57 &WTOREPLY control variable 61
&MSGCNT control variable 57
&MSGCOJBN control variable 57
&MSGCPROD control variable 57
Index 189
control variables, NetView command list language (continued) CURSYS
&MSGCNT 57 NetView command list language control variable 78
&MSGCOJBN 57 REXX function 78
&MSGCPROD 57 customer support 179
&MSGCSPLX 58
&MSGCSYID 58
&MSGDOMFL 58
&MSGGBGPA 58
D
DATA (%DATA) directive 20
&MSGGDATE 58
Data REXX 16
&MSGGFGPA 59
/*%DATA directive 20
&MSGGMFLG 59
/*%LOGIC directive 20
&MSGGMID 59
host command environment 27
&MSGGSEQ 59
processing 20
&MSGGSYID 59
data set information functions 46
&MSGGTIME 59
data set, information functions 46
&MSGID 52
data set, MVS 3
&MSGORIGIN 53
DATE control variable 83
&MSGSRCNM 60
DBCS 93
&MSGSTR 53
deallocating data sets, NetView 28
&MSGTOKEN 60
DEFAULTS command 6
&MSGTSTMP 54
DESC
&MSGTYP 60
NetView command list language control variable 55
&MVSLEVEL 79
REXX function 55
&MVSRTAIN 54
WTO, WTOR commands 55
&NCCFCNT 45
developerWorks, searching for problem resolution in IBM 177
&NETID 79
directory names, notation xiii
&NETVIEW 79
DISC
&NVDELID 54
NetView command list language control variable 79
&OPID 77
REXX function 79
&OPSYSTEM 80
DISPLAY
&PARMCNT 45
&WAIT operand 135
&PARMSTR 45
display, controlling 13
&PARTID 80
displaying panels 11
&PRTY 60
DISTAUTO
&REPLYID 54
NetView command list language control variable 79
&RETCODE 45
REXX function 79
&RXDEFENV 82
DOMAIN
&RXDEFSTR 82
NetView command list language control variable 79
&RXNUMENV 82
REXX function 79
&RXOVRENV 82
domain information, REXX functions 45
&RXOVRSTR 82
double-byte character set characters (DBCS)
&SESSID 54
&CONCAT, using 113
&SMSGID 61
&SUBSTR, using 121
&STCKGMT 80
coding conventions, NetView command list language 93
&SUPPCHAR 80
PPT, command list 13
&SYSCONID 61
DOUBLESUPP character 94
&SYSID 61
DROPCL 5
&SYSPLEX 80
DSPRSTAT, example command list 169
&TASK 80
&TIME 83
&VTAM 81
&VTCOMPID 81 E
&WAIT, using 133 ECVTPSEQ
&WEEKDAYN 81 REXX function 79
&WTOREPLY 61 editing facilities, updating command lists 2
comparing REXX functions 156 education
definition 100 see Tivoli technical training xi
MSGITEM(n) 52 ENDWAIT, &WAIT operand 132, 135
CONTWAIT, &WAIT operand 135 ENVDATA
conventions REXX function 79
typeface xiii environment addressed by REXX, changing 26
COS return codes 150 environment variables, notation xiii
creating command lists 2 ERR, &CONTROL operand 105
CURCONID ERROR, &WAIT operand 131
NetView command list language control variable 78 errors, handling
REXX function 78 NetView command list language 132
REXX 31
Index 191
functions (continued)
REXX (continued)
H
MSGTYP() 60 hardware monitor commands, using 10
MSGVAR(n) 54 HCOPY
MSUSEG() 71 NetView command list language control variable 82
MVSLEVEL 79 REXX function 82
MVSRTAIN() 54 HDRMTYPE
NETID() 79 NetView command list language control variable 49
NETVIEW() 79 REXX function 49
NPDABA() 71 hexadecimal notation (NetView command list language) 101
NVCNT() 45 HIER function
NVDELID() 54 NetView command list language 114
NVID(n) 46 REXX 63
NVSTAT() 46 HMEPNAU function 65
OPID() 77 HMEPNET function 65
OPSYSTEM() 80 HMEPNETV function 66
PANEL() 80 HMFWDSNA function 67
PARMCNT() 45
PARTID() 80
PRTY() 60 I
REPLYID() 54 IBM developerWorks, searching for problem resolution in 177
restrictions 25 IBM Redbooks, searching for problem resolution in 177
ROUTCDE() 61 IBM technotes, searching for problem resolution in 177
RXDEFENV() 82 IF control statement 123
RXDEFSTR() 82 IFRAUGMT
RXNUMENV() 82 NetView command list language control variable 49
RXOVRENV() 82 REXX function 49
RXOVRSTR() 82 IFRAUI3X
SESSID() 54 NetView command list language control variable 50
SMSGID() 61 REXX function 50
STCKGMT() 80 IFRAUIN3
STORAGE() 25 NetView command list language control variable 50
SUBSYM() 40 REXX function 50
SUPPCHAR() 80 IFRAUIND
SYSCONID() 61 NetView command list language control variable 50
SYSID() 61 REXX function 50
SYSPLEX() 80 IFRAUSB2
TASK() 80 NetView command list language control variable 50
TGLOBAL() 48 REXX function 50
TOWER() 81 IFRAUSC2
TYPE() 81 NetView command list language control variable 50
VTAM() 81 REXX function 50
VTCOMPID() 81 IFRAUSDR
WEEKDAYN() 81 NetView command list language control variable 50
WTOREPLY 61 REXX function 50
functions, data set information 46 IFRAUSRB
NetView command list language control variable 50
REXX function 50
G IFRAUSRC
GETCG example NetView command list language control variable 51
REXX 170 REXX function 51
global variable information functions 48 IFRAUTA1
global variables NetView command list language control variable 51
common REXX function 51
NetView command list language 143 IFRAUWF1
task NetView command list language control variable 51
NetView command list language 142 REXX function 51
GLOBALV index for searching the library ix, 177
instruction information centers, searching for problem resolution 177
NetView command list language 148 information function, MSU 62
GLOBVAR1 example 148 initialization, running command lists 6
GO command 133 instructions, REXX
GOTO control statement 125 ADDRESS 26
GREETING example CALL 25
REXX 171 comparison, NetView command list language control
statements 155
definition 15
Index 193
MSGGDATE
NetView command list language control variable 58
N
REXX function 58 NCCFCNT NetView command list language control
MSGGFGPA variable 45
NetView command list language control variable 59 NCCFID
REXX function 59 built-in function 46, 118
MSGGMFLG NCCFSTAT built-in function 46, 119
NetView command list language control variable 59 nested command lists
REXX function 59 definition 7
MSGGMID NetView command list language, using &WAIT 134
NetView command list language control variable 59 REXX
REXX function 59 Assembler, C, PL/I command procedures 29
MSGGSEQ using MSGREAD 35
NetView command list language control variable 59 using TRAP 34
REXX function 59 using WAIT 34
MSGGSYID testing 8
NetView command list language control variable 59 NETVIEW
REXX function 59 NetView command list language control variable 79
MSGGTIME REXX function 79
NetView command list language control variable 59 NetView command list language
REXX function 59 coding conventions 91
MSGID comments 101
REXX function 52 comparison, REXX 155
MSGITEM, NetView command list language control features 91
variable 52 functions, built-in 103
MSGITEM, REXX function 52 labels 94
MSGORIGIN, NetView command list language control null statements 102
variable 53 variables 95
MSGORIGN, REXX function 53 NetView commands
MSGREAD using &PAUSE 109
setting functions 35 using &WAIT 132
MSGROUTE command 85 network commands, using 10
MSGSRCNM network control program, activating, command lists 2
NetView command list language control variable 60 newsgroups xii
REXX function 60 NOINPUT, &PAUSE operand 109
MSGSTR NOSUB, &BEGWRITE operand 107
NetView command list language control variable 53 notation
REXX function 53 environment variables xiii
MSGTOKEN path names xiii
NetView command list language control variable 60 typeface xiii
REXX function 60 NPDABA function 71
MSGTSTMP REXX usage examples 76
NetView command list language control variable 54 null statements 102
REXX function 54 nulls stripping 83
MSGTYP NVCNT function 45
NetView command list language control variable 60 NVDELID
REXX function 60 NetView command list language control variable 54
MSGVAR, REXX function 54 REXX function 54
MSU (management services unit) functions NVID function 46
NetView command list language (built-in functions) 111 NVSTAT function 46
REXX 114
MSU information function 62
MSUSEG function 71, 117 O
REXX usage examples 74 online publications
multiline messages, using 130 accessing x
MVS operands
command 10 ALL, &CONTROL control statement 105
creating data sets 3 CMD, &CONTROL control statement 105
message processing information 55 CONTINUE, &WAIT control statement 135
MVSLEVEL CONTWAIT, &WAIT control statement 135
NetView command list language control variable 79 DISPLAY
REXX function 79 &WAIT control statement 135
MVSRTAIN ENDWAIT, &WAIT control statement 132, 135
NetView command list language control variable 54 ERR, &CONTROL control statement 105
REXX function 54 ERROR, &WAIT control statement 131
NOINPUT, &PAUSE control statement 109
NOSUB, &BEGWRITE control statement 107
Index 195
RXDEFENV (continued) SYSID
REXX function 82 NetView command list language control variable 61
RXDEFSTR REXX function 61
NetView command list language control variable 82 SYSPLEX
REXX function 82 NetView command list language control variable 80
RXNUMENV REXX function 80
NetView command list language control variable 82 system commands, using 10
REXX function 82
RXOVRENV
NetView command list
REXX function 82
language control variable 82 T
TAF
RXOVRSTR
session example 2
NetView command list language control variable 82
TASK
REXX function 82
NetView command list language control variable 80
REXX function 80
task global variables
S command list examples, reference, define, update 144
SAY instruction, using 22, 25 NetView command list language 142
scope checking TE command 30
variables, NetView command list language 145 technotes, searching for problem resolution in IBM 177
search command, Acrobat (for library search) ix, 177 terminal information
SECURITY NetView command list language control variables 82
controlling access, command lists 4 REXX functions 82
running command lists when NetView is started 6 TGLOBAL
using network commands in command lists 10 control statement 142
SESSID REXX function 48
NetView command list language control variable 54 THEN clause, &IF control statement 124
REXX function 54 TIME control variable 83
session time intervals, running command lists 7
information Tivoli software information center x
NetView command list language control variables 77 Tivoli technical training xi
REXX functions 77 tokens, message
monitor commands, command list 10 NetView command list language 129
TAF example 2 TOWER
SIGNAL instruction 31 REXX function 81
SMSGID TRACE END command 30
NetView command list language control variable 61 TRACE START command 30
REXX function 61 tracing, REXX command lists 30
Software Support training, Tivoli technical xi
contacting 179 translating code points 38
describing problems 180 translation functions
determining business impact 180 code-to-text function (CODE2TXT) 38
receiving weekly updates 178 translation tables, code-to-text 38
submitting problems 180 TRAP
STACK command 133 REXX command list 34
status monitor commands, command list 10 TS command 30
STCKGMT TSO/E environment 28
NetView command list language control variable 80 TSO/E EXECIO command 27
REXX function 80 TYPE
STORAGE function 25 REXX function 81
STRING, &PAUSE operand 109 TYPE, command list example 174
stripping, nulls and blanks 83 typeface conventions xiii
SUB, &BEGWRITE operand 108 TYPEIT, command list example 174
SUBSTR built-in function 120
SUBSYM, REXX function 40
SUPPCHAR 80, 93
SUPPCHAR control variable 80
U
UNSTACK command 133
SUPPRESS
user group on Yahoo, NetView 177
&WAIT operand 135
user variables 100
suppressing
user-written command procedure, activating command lists 9
messages 85
non-REXX commands, REXX command lists 23
suppression characters 93
SYSCONID V
NetView command list language control variable 61 variables
REXX function 61 command list information
NetView command list language 40
W
WAIT
NetView command list language control statement
coding suggestions 137
control and parameter variables 133
customizing 135
ending 132, 137
general 127
nested command lists, using 134
NetView commands, using 132
sample using 138
REXX instruction
nested REXX command lists, using 34
Web site, NetView 177
WEEKDAYN
NetView command list language control variable 81
REXX function 81
WRITE control statement 105
WTOREPLY 61
Index 197
198 Programming: REXX and the NetView Command List Language
Printed in USA
SC31-8862-01