REXX and The NetView Command List Language
REXX and The NetView Command List Language
REXX and The NetView Command List Language
Version 6 Release 3
IBM
SC27-2861-05
Note
Before using this information and the product it supports, read the information in “Notices” on page
191.
This edition applies to version 6, release 3 of IBM Z NetView (product number 5697-NV6 ) and to all subsequent
versions, releases, and modifications until otherwise indicated in new editions.
This edition replaces SC27-2861-04.
© Copyright International Business Machines Corporation 1997, 2019.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
Contents
Figures................................................................................................................ vii
About this publication...........................................................................................ix
Intended audience...................................................................................................................................... ix
Publications................................................................................................................................................. ix
IBM Z NetView library............................................................................................................................ ix
Related publications ............................................................................................................................. xi
Terminology in this Library.................................................................................................................... xi
Using IBM Z NetView online help.......................................................................................................... xi
Accessing publications online.............................................................................................................. xii
Ordering publications ...........................................................................................................................xii
Accessibility ............................................................................................................................................... xii
Tivoli user groups....................................................................................................................................... xii
Support information................................................................................................................................... xii
Conventions used in this publication........................................................................................................ xiii
Typeface conventions ......................................................................................................................... xiii
Operating system-dependent variables and paths.............................................................................xiii
Syntax diagrams...................................................................................................................................xiii
iii
Data REXX Directives........................................................................................................................... 17
/*%DATA...............................................................................................................................................17
/*%LOGIC............................................................................................................................................. 18
Coding Conventions for REXX Command Lists and Data REXX Files....................................................... 19
Record Size........................................................................................................................................... 19
Using Quotation Marks......................................................................................................................... 19
Suppressing Display of Non-REXX Commands................................................................................... 21
Z NetView Restrictions on REXX Instructions...........................................................................................21
Pausing for Operator Input.................................................................................................................. 21
Using the SAY Instruction.................................................................................................................... 22
Using the CALL Instruction.................................................................................................................. 22
NetView Restrictions on REXX Functions................................................................................................. 23
Writing REXX Function Packages.............................................................................................................. 23
Changing the Environment Addressed by REXX Command Lists.............................................................23
Data REXX Host Command Environment ................................................................................................. 24
Using the EXECIO Command.....................................................................................................................24
Using MVS and VTAM Commands............................................................................................................. 24
Using the NetView ALLOCATE and FREE Commands............................................................................... 25
Using REXX Command Lists...................................................................................................................... 25
Nesting REXX Command Lists from Assembler, C, or PL/I.......................................................................26
Parsing in REXX Command Lists................................................................................................................26
Tracing REXX Command Lists................................................................................................................... 26
Return Codes in REXX Command Lists..................................................................................................... 27
Recovering from Errors in REXX Command Lists......................................................................................28
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX
Files................................................................................................................ 33
Translation Functions................................................................................................................................ 34
IP Address Processing...............................................................................................................................37
Command List Information........................................................................................................................38
Cross-Domain Information Functions.......................................................................................................45
Data Set Information Functions................................................................................................................ 46
Global Variable Information Functions..................................................................................................... 48
Message Processing Information Functions............................................................................................. 48
Message Processing Information........................................................................................................ 49
ROUTCDE Examples............................................................................................................................. 65
Command Processing Information Functions.......................................................................................... 65
REXX Management Services Unit Information Functions........................................................................ 67
Hardware Monitor (HMxxxxxx) Examples........................................................................................... 76
MSUSEG Syntax and Examples............................................................................................................79
Probable Cause Syntax and Examples................................................................................................ 81
Operator Information Functions................................................................................................................82
Session Information Functions................................................................................................................. 83
REXX Environment Information Functions............................................................................................... 90
Terminal Information Functions................................................................................................................91
Time and Date Variables............................................................................................................................91
String Utility............................................................................................................................................... 91
Nulls and Blanks Stripping........................................................................................................................ 92
iv
Routing Messages from Automation-Table-Driven Command Lists........................................................ 95
Implementing NetView Automation......................................................................................................... 95
Suppressing Messages.........................................................................................................................95
Determining the Environment for a Command List............................................................................. 96
Testing Automation Command Lists....................................................................................................96
Looping and Automation...................................................................................................................... 97
Considering Operator Interaction........................................................................................................97
Common Automation Problems...........................................................................................................97
v
Using &WAIT in Nested Command Lists........................................................................................... 137
Customizing the &WAIT Statement...................................................................................................137
Ending &WAIT If CONTWAIT Is in Effect.......................................................................................... 139
Suggestions for Coding &WAIT..........................................................................................................140
Sample Using &WAIT......................................................................................................................... 140
Notices..............................................................................................................191
Programming Interfaces..........................................................................................................................192
Trademarks..............................................................................................................................................192
Privacy policy considerations.................................................................................................................. 193
Index................................................................................................................ 195
vi
Figures
vii
24. HMORIGIN Example................................................................................................................................. 79
45. CLIST1 Command List to Define, Update, and Reference Task Global Variables................................ 145
viii
About this publication
The IBM Z® NetView® product provides advanced capabilities that you can use to maintain the highest
degree of availability of your complex, multi-platform, multi-vendor networks and systems from a single
point of control. This publication, IBM Z NetView Programming: REXX and the NetView Command List
Language, describes how to write command lists for the NetView product using either the Restructured
Extended Executor (REXX) language or the NetView command list language.
Note: This publication does not provide descriptions of NetView commands. If a command is not familiar,
see the NetView online help.
Intended audience
This publication is for system programmers and operators who write or run REXX programs under
NetView control. A REXX program can be used as a regular command, as a subroutine, as a function from
either a regular command or a subroutine, or as Data REXX. Readers should be familiar with how the
NetView program is used in their network.
Publications
This section lists publications in the IBM Z NetView library and related documents. It also describes how
to access NetView publications online and how to order NetView publications.
x IBM Z NetView: Programming: REXX and the NetView Command List Language
Related publications
For more information about REXX, refer to the TSO/E REXX library.
You can find additional product information on the IBM Z NetView web site at https://www.ibm.com/us-
en/marketplace/ibm-tivoli-netview-for-zos.
For information about the NetView Bridge function, see Tivoli NetView for OS/390® Bridge Implementation,
SC31-8238-03 (available only in the V1R4 library).
Ordering publications
You can order many Tivoli publications online at http://www.ibm.com/e-business/linkweb/publications/
servlet/pbi.wss
You can also order by telephone by calling one of these numbers:
• In the United States: 800-426-4968
• In Canada: 800-879-2755
In other countries, contact your software account representative to order Tivoli publications. To locate
the telephone number of your local representative, perform the following steps:
1. Go to http://www.ibm.com/e-business/linkweb/publications/servlet/pbi.wss.
2. Select your country from the list and click the grey arrow button beside the list.
3. Click About this site to see an information page that includes the telephone number of your local
representative.
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: NetView.
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:
Online
Please follow the instructions located in the support guide entry: https://www.ibm.com/support/
home/pages/support-guide/?product=4429363.
Troubleshooting information
For more information about resolving problems with the IBM Z NetView product, see the IBM Z
NetView Troubleshooting Guide. You can also discuss technical issues about the IBM Z NetView
product through the NetView user group located at https://groups.io/g/NetView. This user group is for
IBM Z NetView customers only, and registration is required. This forum is also monitored by
interested parties within IBM who answer questions and provide guidance about the NetView
xii IBM Z NetView: Programming: REXX and the NetView Command List Language
product. When a problem with the code is found, you are asked to open an official case to obtain
resolution.
Typeface conventions
This publication uses the following typeface conventions:
Bold
• Lowercase commands and mixed case commands that are otherwise difficult to distinguish from
surrounding text
• Interface controls (check boxes, push buttons, radio buttons, spin buttons, fields, folders, icons, list
boxes, items inside list boxes, multicolumn lists, containers, menu choices, menu names, tabs,
property sheets), labels (such as Tip:, and Operating system considerations:)
• Keywords and parameters in text
Italic
• Citations (examples: titles of publications, diskettes, and CDs
• Words defined in text (example: a nonswitched line is called a point-to-point line)
• Emphasis of words and letters (words as words example: "Use the word that to introduce a
restrictive clause."; letters as letters example: "The LUN address must start with the letter L.")
• New terms in text (except in a definition list): a view is a frame in a workspace that contains data.
• Variables and values you must provide: ... where myname represents...
Monospace
• Examples and code examples
• File names, programming keywords, and other elements that are difficult to distinguish from
surrounding text
• Message text and prompts addressed to the user
• Text that the user must type
• Values for arguments or command options
Syntax diagrams
The following syntax elements are shown in syntax diagrams. Read syntax diagrams from left-to-right,
top-to-bottom, following the horizontal line (the main path).
• “Symbols” on page xiv
• “Parameters” on page xiv
• “Punctuation and parentheses” on page xiv
Symbols
The following symbols are used in syntax diagrams:
Parameters
The following types of parameters are used in syntax diagrams:
Required
Required parameters are shown on the main path.
Optional
Optional parameters are shown below the main path.
Default
Default parameters are shown above the main path. In parameter descriptions, default parameters
are underlined.
Syntax diagrams do not rely on highlighting, brackets, or braces. In syntax diagrams, the position of the
elements relative to the main syntax line indicates whether an element is required, optional, or the
default value.
When you issue a command, spaces are required between the parameters unless a different separator,
such as a comma, is specified in the syntax.
Parameters are classified as keywords or variables. Keywords are shown in uppercase letters. Variables,
which represent names or values that you supply, are shown in lowercase letters and are either italicized
or, in NetView help, displayed in a differentiating color.
In the following example, the USER command is a keyword, the user_id parameter is a required variable,
and the password parameter is an optional variable.
USER user_id
password
xiv IBM Z NetView: Programming: REXX and the NetView Command List Language
When examples of commands are shown, commas are also used to indicate the absence of a positional
operand. For example, the second comma indicates that an optional operand is not being used:
COMMAND_NAME opt_variable_1,,opt_variable_3
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.
Syntax examples
The following examples show the different uses of syntax elements:
• “Required syntax elements” on page xv
• “Optional syntax elements” on page xv
• “Default keywords and values” on page xv
• “Multiple operands or values” on page xvi
• “Syntax that is longer than one line” on page xvi
• “Syntax fragments” on page xvi
A required choice (two or more items) is shown in a vertical stack on the main path. The items are shown
in alphanumeric order.
REQUIRED_OPERAND_OR_VALUE_1
REQUIRED_OPERAND_OR_VALUE_2
OPTIONAL_OPERAND
A required choice (two or more items) is shown in a vertical stack below the main path. The items are
shown in alphanumeric order.
OPTIONAL_OPERAND_OR_VALUE_1
OPTIONAL_OPERAND_OR_VALUE_2
KEYWORD1 OPTION=*
COMMAND_NAME
KEYWORD1 OPTION= *
KEYWORD2 VALUE1
KEYWORD3 VALUE2
REPEATABLE_OPERAND_OR_VALUE_1
REPEATABLE_OPERAND_OR_VALUE_2
REPEATABLE_OPERAND_OR_VALUE_3
value_n )
OPERAND7 OPERAND8
Syntax fragments
Some syntax diagrams contain syntax fragments, which are used for lengthy, complex, or repeated
sections of syntax. Syntax fragments follow the main diagram. Each syntax fragment name is mixed case
and is shown in the main diagram and in the heading of the fragment. The following syntax example
shows a syntax diagram with two fragments that are identified as Fragment1 and Fragment2.
COMMAND_NAME Fragment1
Fragment2
Fragment1
KEYWORD_A= valueA KEYWORD_B KEYWORD_C
Fragment2
KEYWORD_D KEYWORD_E= valueE KEYWORD_F
xvi IBM Z NetView: Programming: REXX and the NetView Command List Language
Basic Topics
The Z NetView program can be used to manage complex, multivendor networks and systems from a
single point. A command list is a set of commands and special instructions that are grouped under one
name, like a computer program. For the Z NetView program, a command list can be written in either
Restructured Extended Executor language (REXX) or the NetView command list language.
REXX has many functions and enhancements that are not available in the NetView command list
language.
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
4 for more information.
This chapter describes how to:
• Create command lists
• Run command lists
• Use command lists
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 Z NetView Command Reference
Volume 2 (O-Z).
/* 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
receive if they issue all three commands.
//DSICLD DD DSN=datasetname,DISP=SHR
3. Concatenate data sets by coding the DSICLD statement as shown in Figure 2 on page 2.
//DSICLD DD DSN=datasetname1,DISP=SHR
// DD DSN=datasetname2,DISP=SHR
// DD DSN=datasetname3,DISP=SHR
// DD DSN=datasetnamen,DISP=SHR
2 IBM Z NetView: Programming: REXX and the NetView Command List Language
Basic Topics
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.
When the IBM Z NetView program is operating on a z/OS system and you plan to update or create
command lists while it 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 must compress the data set to add more command lists, use the
REACC command; for more information, see the IBM Z NetView Command Reference Volume 2 (O-Z). 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 Z NetView
Programming: Pipes.
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.
4 IBM Z NetView: Programming: REXX and the NetView Command List Language
Basic Topics
For more information about the PROFILE definition statement, refer to the IBM Z NetView 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:
• To start autotasks, use AUTOTASK commands. Use START commands to start other tasks, such as DSTs
(data services tasks).
• 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.
• To set operator-specific defaults that override NetView-wide values set using the DEFAULTS command,
use the OVERRIDE command.
or MSU reported that an NCP failed, the command list can issue the VTAM command to reactivate the
NCP. Chapter 5, “Automation Resource Management,” on page 95 contains additional information about
performing NetView automation using command lists.
6 IBM Z NetView: Programming: REXX and the NetView Command List Language
Basic Topics
When planning to create command lists that run other command lists, keep in mind the following
considerations:
• A REXX command list can be called as a REXX command, subroutine, or function.
• 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.
• A command list written in the NetView command list language can call another command list written in
either the NetView command list language or in a REXX command list as a command.
• Command lists written in REXX and command lists written in the NetView command list language can
call each other.
• 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.
• 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.
control such access using REXX 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 called 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 27.
If the calling command list is written in REXX, it might be able 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 28.
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.
8 IBM Z NetView: Programming: REXX and the NetView Command List Language
Basic Topics
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.
10 IBM Z NetView: Programming: REXX and the NetView Command List Language
Basic Topics
Many commands cannot run under the PPT. These are some restrictions that apply to command lists that
run under the PPT:
• 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
– TRAP
– WAIT
• Do not use the following REXX instructions:
– FLUSHQ
– MSGREAD
– PARSE EXTERNAL
– PARSE PULL if nothing is in the REXX data stack
– PULL if nothing is in the REXX data stack
• Do not use the following NetView command list language control statements:
– &PAUSE
– &WAIT
When command lists running under the PPT generate messages, the messages go to the authorized
receiver, if any. If no authorized receiver exists, these messages go to the system console and they
should not contain non-Latin characters, such as double-byte characters.
The commands and messages that are displayed during processing of a command list are shown in the
message area of the NetView command facility panel. Generally, output from the command list is
preceded by a type code of C. For a complete description of the NetView panel layout and the format of
messages sent to the panel, refer to the IBM Z NetView User's Guide: NetView.
• A pipeline. When calling of the procedure is triggered by a message passed from a previous stage, then
that message becomes the current message.
• For REXX, a MSGREAD that occurs after a successful TRAP of a message. For NetView CLIST language,
an &WAIT. See “Control and Parameter Variables Used with &WAIT” on page 135 for more information
about using control variables with &WAIT.
• When the procedure calls a NetView pipeline with SAFE * operating as a "not first" stage.
All of the previously listed means of setting a current message 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 67), or message information
commands (refer to “Commands Used in Command Lists” on page 164).
Note:
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:
If the LINECOUNT variable contains 0, no current message exists. If the LINECOUNT variable contains
a value other than 0, a current message does exist.
3. REXX functions that return data pertinent to the current message do so regardless of how the message
was made current. For multiline messages, only the first line is considered by these functions, unless
documentation for that function states otherwise.
4. When a MSGREAD, &WAIT or PIPE SAFE * occurs, the resulting message becomes the current
message, even if the message is null (such as when MSGREAD has RC=4).
12 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Language Overview
This chapter includes a brief introduction to REXX. Not all of the features and syntax rules of REXX are
described in this document. This document focuses primarily on the REXX instructions and functions
provided by the Z NetView program.
Note: For complete information about REXX, refer to the TSO/E REXX library.
3. The Z 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:
• The object deck must be created and saved from a REXX compiler.
• 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.V6R2M0.EAGPRC.
– The load module can be called only 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 runtime library in an authorized library on the system that runs the compiled REXX
command lists.
14 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Language Overview
When the /*%DATA directive is in effect, embedded or literal data is programmed exactly as the
application program expects to see it. REXX programming, including generated data clauses for the
NETVDATA address environment, is written with %> in columns 1 and 2 of each record. This is also
referred to as data mode.
Sample BNJMBDST is an example of a logic file. Sample CNMCMSYS is an example of a data file. Sample
CNMSTASK uses both data and logic formats.
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 is to 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 Z NetView program on
which your application is currently running, you might code the following statement starting in column 1:
If the domain name of the Z NetView program on which your application is currently running is CNM01,
then the following data record is read:
If a Data REXX generated data record is written to be continued on the next record, include %> at the
beginning of column 1 of the next record. For example, to write a continuation for the previous example
that contains the version and release of the Z NetView program on which your application is currently
running, code the following statements starting in column 1:
%> 'My domain name is' domain() 'and my NetView version is',
%> substr(netview(),3,1) 'and release is,
%> substr(netview(),4,1)'.'
If the domain name of the Z NetView program on which your application is currently running is CNM01,
and the Z NetView program version is 5 and the release is 4, then the following data record is read:
checked to determine if they are Data REXX files (as determined by the first line) and are processed,
independently, in the same three-step manner if they are.
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:
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.
Line 6 is conditional on the previous IF-THEN evaluation, although it is not prefixed with the %> data REXX
designator. Line 6 is not evaluated by the Data REXX interpreter, despite its similarity to REXX code. This
line is sent exactly as written to the NETVDATA address environment (if the tower('AON') function is
evaluated as true). The same is true if line 6 was an %INCLUDE instruction. In such a case, the
%INCLUDE statement is processed by the Z NetView program after the Data REXX program completes.
Additional Information
The following information applies to both data and logic files:
• Data REXX is supported only in the following places:
– CNMCMD
– CNMSTYLE include members
– 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
– HELPMAP
• Data REXX is not supported in VSAM files.
• REXX clauses that are processed as commands in a typical REXX environment are instead passed to the
NETVDATA environment. As a result, these clauses are seen as data by the application reading the
member.
• Data REXX files must be small because they are read entirely into storage. %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
16 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Language Overview
Data REXX files are not read entirely into storage. Therefore, to save storage, do not use Data REXX files
in %INCLUDE files.
• Output strings that result from SAY and TRACE instructions are written to the network log.
• The REXX keyword instruction ADDRESS can be used; however, only the NETVDATA address is
supported.
• The following REXX functions cannot be used in Data REXX files:
– GETMSG
– LISTDSI
– MSG
– MVSVAR
– OUTTRAP
– PROMPT
– SETLANG
– STORAGE
– SYSDSN
– SYSVAR
• The following REXX keyword instructions cannot be used in Data REXX files:
– TRACE ? (interactive trace)
– PARSE EXTERNAL
• 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.
• REXX functions called 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.
The NetView REXX /*%DATA directive has the following syntax:
/*%DATA
/ * % DATA comments * /
where:
/*%DATA
The /*%DATA directive must begin with the slash symbol (/) 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
• 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 example shows how to code Data REXX in data mode:
/*%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.
The NetView REXX /*%LOGIC directive has the following syntax:
/*%LOGIC
/ * % LOGIC comments * /
where:
/*%LOGIC
The /*%LOGIC directive must begin with the slash symbol (/) 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
• 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.
• In logic mode, REXX instructions must not be preceded by %>.
Example: The following example shows how to code Data REXX in logic mode:
18 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Language Overview
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 Z NetView program.
Record Size
The data portion of records in REXX command lists or Data REXX files for the Z 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 Z NetView program
removes 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 Z 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.
These two instructions display the following text at your terminal when using REXX or write to the
network log when using Data REXX:
To use an apostrophe or double quotation marks within the text of a string enclosed in quotation marks,
you can code the following lines:
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:
Generally, you enclose any NetView commands, or system commands recognized by the Z NetView
program, in quotation marks. The exception is when you want variable substitution to take place on an
operand of such a command. If you want variable substitution to take place, leave the operand outside
the quotation marks.
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'
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:
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 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'
Note:
1. Use caution when writing REXX clauses that have quoted strings that span multiple records. Because
the Z 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 Z NetView program
removes the blanks in the middle of the quoted string from the output.
Enter the following command:
say 'ABC
DEF'
ABCDEF
All the trailing blanks were removed between the characters C and D.
Blanks that are to be retained are coded on the next line as in the following example:
say 'ABC
DEF'
ABC DEF
2. When it is necessary to continue a quoted string on the next line in a NetView command list, code the
following statement:
Notice that the continuation comma displays a blank at your terminal after displaying the first quoted
string. If you do not want the space, you can use concatenation bars to eliminate it. This is useful when
you code long system commands in your command list. Code the concatenation bars in the following
way:
20 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Language Overview
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 must 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, data exists 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:
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 14.
22 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Language Overview
See the TSO/E REXX library for more information about these commands and the REXX ADDRESS
instruction.
In the NETVIEW addressing environment, the entire command string is converted to uppercase
characters. If you want to issue a command using lowercase characters, change the addressing
environment to NETVASIS, in the following way:
Note:
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 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. The Z NetView program cannot link or attach to any such program that can perform
program calls.
3. The Z NetView program does not support a TSO/E environment in the NetView address space.
4. The Z NetView program returns an error if you try to run a command that is routed to an incorrect
addressing environment.
5. The ADDRESS command supports only address environment NETVDATA when issued from Data REXX
files.
24 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Language Overview
Each time a REXX command list is run in the Z NetView program, REXX sets up a REXX environment for
the Z NetView program. When the command list ends, this unique environment can be held for reuse by
the same task. If two command lists are running at the same time on one operator task (for example, one
command list is suspended while the other is running), two environments are required. Any REXX
command lists called from another REXX command list use the REXX environment of the caller.
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. See the NetView online help for additional information about the DEFAULTS
and OVERRIDE commands.
The Z NetView program retains REXX environments to improve REXX environment initialization
performance. If more than one REXX environment is available when a REXX command list is run, the
REXX command list can run using a different REXX environment. Whether this occurs depends on the
order in which other REXX command lists were started and ended during concurrent processing of the
REXX command lists. Storage associated with each REXX environment can increase depending on the
needs of the REXX command lists. Since each REXX command list can have different storage needs, REXX
environments can grow to meet the needs of the most demanding REXX command list.
You can reduce the number of REXX environments the Z NetView program retains, to minimize the
storage each task using REXX requires. However, if you set this number to zero, the Z 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.
Note:
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 Z 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.
3. The number of REXX environments that are allowed to be initialized by any NetView task can be
controlled through the use of the DEFAULTS command REXXENVL keyword and the OVERRIDE
command REXXENVL keyword. The number of initialized REXX environments for a NetView task and
their relative percentage to all REXX environments can be displayed using the LIST operator command
or the LIST STATUS=TASKS,RXENVCNT=YES command. The latter command also displays the total
number of REXX environments that are available to NetView and the total number of REXX
environments that are initialized followed by the percentage of the total number in parentheses. It
also displays the number of REXX environments that are initialized for each NetView task followed by
the percentage of the total number in parentheses.
See the NetView online help for information about the PIPE EDIT and PARSEL2R commands. See the
REXX library for information about the REXX PARSE instruction.
Note: Data REXX supports only the REXX PARSE instruction.
26 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Language Overview
TS
TS
CNM431I REXX INTERACTIVE TRACE. ENTER 'GO TRACE OFF' TO END TRACE,
ENTER 'GO' TO CONTINUE.
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.
Note: The TS and TE commands are not supported in Data REXX.
The TE command has the following syntax:
TE
TE
For more information about TS and TE, see the NetView online help.
See “Recovering from Errors in REXX Command Lists” on page 28 for more information about using the
SIGNAL instruction with the Z NetView program.
28 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView REXX Instructions
Some instructions used in REXX command lists for the NetView program are provided as part of the
NetView program so that REXX command lists can perform specific NetView activities. Because these
instructions are provided by the program and are not standard REXX instructions, they can be used only in
command lists that run in a NetView environment. These instructions do not function in REXX EXECs that
are running in non-NetView environments. The REXX instructions provided by the NetView program can
be used only in command lists, and are not available for entry at operator consoles. To handle error
conditions, code the SIGNAL instruction in any REXX command list that uses one of these NetView
instructions.
This chapter contains a description of each REXX instruction provided by the NetView program, how the
instruction works, and how to code the instruction in a REXX command list.
See Appendix D, “Comparison of REXX and NetView Command List Language,” on page 149 for a
complete list of the REXX instructions that are equivalent to NetView command list language control
statements. This list includes both instructions provided by NetView and instructions provided by REXX.
Note that the REXX instructions MSGREAD and FLUSHQ are provided by the NetView program; however,
these instructions are not supported by Data REXX. No commands are support by Data REXX.
Pipelines, called with the PIPE command, provide both extended function and reduced complexity for the
automation of message handling. The PIPE command is an alternative to the TRAP and WAIT instructions.
For information about NetView pipelines, see the IBM Z NetView Programming: Pipes.
For more information about REXX syntax rules and information about other REXX instructions, see the
REXX library.
TRAP, WAIT, and MSGREAD monitor the operator station task (OST) for specific messages or wait for a
specified period.
Use the TRAP command to define the messages for which the command list must 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 is received, or when a Persist action provides a message for the TRAP
instruction. When a WAIT instruction completes, the value returned by the EVENT() function indicates 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.
See the NetView online help for more information about these REXX instructions and their syntax.
REXX command lists called as subroutines or functions are considered to be part of the calling command
list. Therefore, TRAP commands issued from subroutines or functions operate the same as if they were
called in the calling command list.
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.
To prevent that from happening, you can take one of the following actions:
• End the calling command list.
• Issue the instruction TRAP NO MESSAGES.
• Issue the instruction FLUSHQ periodically
30 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView REXX Instructions
32 IBM Z NetView: Programming: REXX and the NetView Command List Language
Chapter 4. REXX Instructions for NetView REXX
Command Lists and Data REXX Files
The NetView program provides a number of REXX functions for use only in NetView REXX command lists
and Data REXX files. These functions are provided so that command lists and Data REXX files written in
REXX can perform specific NetView activities. Because these functions are provided by the NetView
program and are not standard REXX functions, you can use them only in command lists and Data REXX
files that run in a NetView environment.
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 the NetView program, is used several
times in the command list without a change in value, use the function once to set a local variable to the
returned value of the function. 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 must 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 related system information of the function.
Use these functions to obtain information about the operating environment, test conditions in a command
list, and take actions based on the results.
For more information about REXX syntax rules and other REXX functions, refer to the REXX library.
See Appendix D, “Comparison of REXX and NetView Command List Language,” on page 149 for a
complete list of the REXX functions that are equivalent to NetView command list language control
variables. This list includes both functions provided by the NetView program and functions provided by
REXX itself.
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 alphabetic order, with the REXX function shown first.
In the tables, the function and control variable are followed by the description.
Note:
1. Where both a NetView command list language control variable and a REXX function exist 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 be 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 7 on page 49 and Table 10 on page 68 return a value consistent with
no message to process when used in Data REXX files.
Translation Functions
Table 1. 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.
The CODE2TXT function has the following syntax:
CODE2TXT
CODE2TXT ( table , code )
where:
code
Indicates the code point to translate. This field is specified as a 1-4 character
value representing the hexadecimal code point. The characters can be
uppercase or lowercase. Leading zeros are ignored but are counted as
characters in the four character limit.
Code points in the SNADATA tables are only two characters. To make them the
same length as code points in other tables, CODE2TXT adjusts your code by
concatenating "00" on the end (for example, "DD" becomes "DD00" and "01"
becomes "0100"). Refer to the BNJ82TBL sample and the IBM Z NetView
Customization Guide for more information.
34 IBM Z NetView: Programming: REXX and the NetView Command List Language
Translation
CODE2TXT(table,code) where:
(continued) table
Specifies the name of the table to use in the translation. The following tables
are valid:
SNAALERT
Systems Network Architecture (SNA) alert description code point
SNACAUSE
SNA probable cause code point
SNADDATA
SNA detailed data code point from subfield X'82'
SNADDAT5
SNA detailed data code point from subfield X'85'
SNADDAT6
SNA actual action code point for resolution major vector
SNAFCAUS
SNA failure cause code point
SNAICAUS
SNA install cause code point
SNAREACT
SNA recommended actions code point
SNAUCAUS
SNA user cause code point
An example of using CODE2TXT follows:
CODE2TXT(SNAALERT,362B)
The example translates code point 362B in the SNAALERT table to "TRANSMITTER
FAILURE".
Error Processing: Error conditions encountered by this function are handled in the
following way:
• 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.
• 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.
• Too many operands: Extraneous operands are ignored.
• 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 35
Translation
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')
36 IBM Z NetView: Programming: REXX and the NetView Command List Language
IP Address Processing
IP Address Processing
Table 2. IP address Processing
Function or Variable Description
IPXLATE('xltype', Used to validate a presentation form IP address and convert it to another format,
'xlindata') either a standard format or a compressed format.
The IPXLATE function has the following syntax:
IPXLATE
IPXLATE ( xltype , xlindata )
Where:
xltype
Is a string containing the type of IP address verification or translation to be
performed. Following are the valid strings:
COMPRESS
Convert an IP address in presentation form to presentation form
compressed, in which one group of multiple, consecutive zero address
segments is replaced by a double-colon (::). The compression applies only
to IPv4-mapped IPv6, IPv4-compatible IPv6, and IPv6 addresses. The
IPv4 addresses are returned in standard presentation form.
STANDARD
Convert an IP address in presentation form to standard presentation form,
in which IPv4, IPv4-mapped IPv6, and IPv4-compatible IPv6 addresses
are presented in dotted decimal IPv4 address format. The IPv6 addresses
are presented in hexadecimal format. In a standard presentation form, all
segments of an address are present and leading zeros are removed.
VERIFY
Verify that the input data is an IP address in presentation form.
V42STD
Convert an IP address in presentation form to an IPv6 presentation form.
The IPv4 and IPv4-mapped IPv6 addresses are presented as IPv4-mapped
IPv6 addresses. All IP addresses are returned in standard presentation
form.
xlindata
Is a string containing an IP address in presentation form.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 37
Command List Information
Where xxxxxx is the variable name which contains the result of the translation,
trancode is the return code from the translation service, and ipaddr, if present, is
the translated address string. The values of trancode are as follows:
0
The function was successful.
4 - 16
The IP address translation failed because of an internal error in the translation
routines. Check the NetView log for the DWO050E message and contact IBM
Software Support.
20 or above
The IP address passed to the service was not valid.
38 IBM Z NetView: Programming: REXX and the NetView Command List Language
Command List Information
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 20 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 also specifying the keyword=
parameter.
Because variable substitution can yield a null value, AUTHCHK can accept a
null value and strip the "=" (equal sign) to yield an only security check. For
example, after variable substitution, this is a valid call of the AUTHCHK
function: AUTHCHK(1=,2=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 items:
• The value of a single variable.
• Two variables with ‘=’ in between. The = sign must be enclosed in single
quotation marks.
• Two literal strings with ‘=’ in between. The = sign must be enclosed in
single quotation marks.
• 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 39
Command List Information
/* NVRXCMD:
SAMPLE REXX PROGRAM
*/
PARSE ARG P1','P2','.
RESULT=AUTHCHK(P1,P2)
…
IF RESULT¬='' THEN
DO
SAY OPID() 'IS NOT AUTHORIZED TO KEYWORD/VALUE' RESULT
EXIT
END
…
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 Z
NetView Administration Reference.
40 IBM Z NetView: Programming: REXX and the NetView Command List Language
Command List Information
AUTHCHKX ( command , )
keyword
keyword=value
where:
command
Specifies the command to be used for the authorization checks. This is a
required parameter. If a null or blank command is passed, a syntax error
occurs. The command parameter can contain a maximum of eight characters.
It cannot contain an embedded blank, comma, or equal sign.
Command security checking is first performed on the command, which can be
a command synonym. If the value is not a valid command, or if the command is
not authorized to be issued by the current operator, the command parameter is
returned.
keyword
Specifies the keyword, or the keyword portion of the keyword=value pair, to be
authority checked. The keyword cannot contain an embedded blank or comma.
Each keyword can contain a maximum of 246 characters. A maximum of 19
keywords with optional values can be passed to the program, because REXX
supports up to 20 parameters on a function call. If the keyword is not a valid
keyword, or if the current operator is not allowed to execute the specified
command with the specified keyword, the keyword is returned.
value
Specifies a value for the keyword. Each value can contain a maximum of 246
characters. You cannot specify value without keyword and the = (equal sign).
Because variable substitution can yield a null value, AUTHCHKX can accept a
null value and strip the = (equal sign) to yield a keyword-only security check.
For example, after variable substitution, this example is a valid call of the
AUTHCHKX function:
AUTHCHKX(command,keyword1=,keyword2=value2
If the current operator is not allowed to execute the specified command with
the specified keyword=value pair, the keyword=value pair is returned.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 41
Command List Information
42 IBM Z NetView: Programming: REXX and the NetView Command List Language
Command List Information
NVCHKAUT NVCLCMD,&P1,&P2
NVCHKAUT can be coded in the following way (after the initial REXX comment
line):
In this example, if either of the parameters passed in parm1 or parm2 does not
pass authority checking with the command passed in cmd, a non-null value is
returned by AUTHCHKX. Because keyword=value is currently running, that
command must be allowed under the current operator. If a keyword fails, it is
included in a message along with the command that was passed, and the REXX
program sets a return code of 8 and returns. If a value fails, the keyword and value
are included in a message along with the command that was passed, and the REXX
program sets a return code of 8 and returns. For example, if OPER1 enters
NVCLCMD START, LU=LU200, but is not authorized to use the START keyword, the
message OPER1 IS NOT AUTHORIZED TO ISSUE NVCLCMD WITH START is
displayed, and NVCHKAUT returns a return code of 8 to NVCLCMD. NVCLCMD
should then end without further processing.
CMDNAME() This REXX-only function returns the name by which the program was called. This
name can be the same as the name returned in the third token by the REXX PARSE
SOURCE command. This name is the command as it was entered, which is possibly
a synonym.
For Data REXX, this function returns the member name of the file that is being
processed.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 43
Command List Information
PARMCNT() Returns the number of parameter variables that are entered when a command list
is initiated. For example, if command list RESC is initiated by entering
&PARMCNT
RESC ACT,LU200, then PARMCNT becomes 2. If no parameter variables exist,
PARMCNT is zero.
&PARMSTR Returns the string of parameter values used when the command list is initiated.
&PARMSTR does not include the command list name. For example, if command list
RESC is initiated by entering RESC ACT,LU200, then &PARMSTR becomes
ACT,LU200. If no parameter variables exist, &PARMSTR is null. The maximum
length of the string returned by &PARMSTR is 255 characters.
44 IBM Z NetView: Programming: REXX and the NetView Command List Language
Cross Domain and Global Variable
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 45
Data Set Information Functions
NVMASTER() Returns the domain name of the master NetView program in the sysplex or a null
value if there is no master 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
&NCCFSTAT name
with 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:
• NVSTAT, a null is returned.
• &NCCFSTAT, an error message is returned.
46 IBM Z NetView: Programming: REXX and the NetView Command List Language
Data Set Information Functions
IF FNDMBR('DSICLD','MYREXX') = 0 THEN
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 47
Message Processing
FNDMBR Note:
(DD_name,member_nam 1. Refer to the MVS/DFP library for the OPEN macro return codes. Refer to the
e) MVS/ESA library for the OPEN macro system abend codes (X'n13' abend codes)
(continued) and IEC1nnI message explanations.
2. If a REXX variable is used to hold the DD name or the member name for the
FNDMBR function, to help insure that the text substituted for the variable does
not exceed 8 characters, strip the leading and trailing blanks from the value
before calling the FNDMBR function.
3. If the NetView ALLOCATE command was used to allocate the data set, be sure
not to use the FREE option on the ALLOCATE when using the FNDMBR function
together with another command (for example, EXECIO) to access the allocated
file. The FNDMBR function runs an MVS OPEN and CLOSE, which causes the
allocated file to be deallocated if the FREE option was coded on the allocate
command. This restriction does not apply to files allocated using the DD
statements in the NetView startup procedure.
4. The data set can be allocated down to the member level. However, do not do
that because an IEC141I message is issued if the member is not found.
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.
NetView Command List Language
The NetView command list language control statement &TGLOBAL is
operationally different than the NetView REXX function described here. See
“Using &TGLOBAL and &CGLOBAL” on page 143.
48 IBM Z NetView: Programming: REXX and the NetView Command List Language
Message Processing
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 12 contains additional information about current message.
AREAID() Returns a 1-letter (A - Z) identifier for the area on the multiple console support
console panel that displays the message.
&AREAID
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.
AUTOTOKE() Returns the 1 - 8 character name of the MVS message processing facility (MPF)
automation token.
&AUTOTOKE
Note: If you have specified AUTO(YES) or AUTO(NO) in the MPF table, the values
YES and NO are not automation tokens.
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.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 49
Message Processing
HDRMTYPE() Specifies the 1-character NetView buffer type of the received message or MSU.
Buffer types are described in IBM Z NetView Programming: Assembler.
&HDRMTYPE
IFRAUGMT() Returns the UTC mean time when the automation internal function request (AIFR)
was created. The variable IFRAUGMT is returned as an 8-byte hexadecimal value
&IFRAUGMT
in store clock format.
50 IBM Z NetView: Programming: REXX and the NetView Command List Language
Message Processing
IFRAUIN3() Returns 1 byte of indicator bits as a series of eight on (1) and off (0) EBCDIC
characters representing the bits in order. This data is mapped in DSIIFR. The
&IFRAUIN3
following bit positions and meanings are valid:
1-2
00 = Default priority
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
&IFRAUI3X
all 32 bits to be accessed at once.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 51
Message Processing
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.
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.
52 IBM Z NetView: Programming: REXX and the NetView Command List Language
Message Processing
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 53
Message Processing
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
&JOBNAME
the name of 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.
The same information is available using MSGCOJBN.
KEY() Returns the 8-character retrieval key associated with the message.
&KEY
54 IBM Z NetView: Programming: REXX and the NetView Command List Language
Message Processing
MCSFLAG() Returns the system message flags in a series of eight on (1) and off (0) EBCDIC
characters representing the bits in order. The following bit positions and meanings
&MCSFLAG
are valid:
1
Send message conditionally to console SYSCONID.
2
Send message unconditionally to console SYSCONID.
3
RESP.
4
REPLY.
5
BRDCST.
6
HRDCPY only.
7
NOTIME.
8
NOCPY.
Note:
1. This function does not return the same mapping of multiple console support
flags as the automation table compare item.
2. Setting MCSFLAG='00000000' is valid. It overrides MCSFLAG set by an
incoming WTO.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 55
Message Processing
MSGAUTH() Returns the 2-character value indicating whether the message was issued from an
authorized program.
&MSGAUTH
00
WTO message is not from MVS.
10
WTO is from an unauthorized program.
11
WTO is from an authorized program.
MSGCATTR() Returns the 16-bit MVS message attribute flags as a series of on (1) and off (0)
EBCDIC characters representing the bits in order. The following bit positions and
&MSGCATTR
meanings are valid:
1
Message is suppressed.
2
Message is a command response.
3
Message issued by authorized program.
4
Message is to be retained by Automation Message Retention Facility (AMRF).
Note: Other bits can be tested but have no defined use.
MSGCMISC() Returns the 8-bit MVS miscellaneous routing flags as a series of on (1) and off (0)
EBCDIC characters representing the bits in order. The following bit positions and
&MSGCMISC
meanings are valid:
1
Display UD (undeliverable) messages.
2
Display only UD messages.
3
Queue by ID only.
4
Indicates whether the message has been marked in the message processing
facility (MPF) table as eligible for NetView automation.
Note:
1. The value is useful only for solicited messages. Examine bit 16 of the ifrauind()
function to verify that the current message is solicited before using this
function.
2. Other bits can be tested but have no defined use.
56 IBM Z NetView: Programming: REXX and the NetView Command List Language
Message Processing
MSGCMSGT() Returns the 16-bit MVS message type flags as a series of on (1) and off (0) EBCDIC
characters representing the bits in order. The following bit positions and meanings
&MSGCMSGT
are valid:
1
Display job names
2
Display status
3
Monitor active
6
Monitor SESS
Note:
1. The value is useful only for solicited messages. Examine bit 16 of the ifrauind()
function to verify that the current message is solicited before using this
function.
2. Other bits can be tested but have no defined use.
MSGCNT() REXX
&MSGCNT Returns the number of items in the message string of the current message (see
“Working with Messages” on page 12 for information about current message).
NetView Command List Language
Returns the number of words in a message string.
See “Control and Parameter Variables Used with &WAIT” on page 135 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.)
&MSGCOJBN
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 57
Message Processing
MSGCSPLX() Returns the 1- 8 character name of the MVS SYSPLEX where the received message
originated.
&MSGCSPLX
Note: The value is useful only for solicited messages. Examine bit 16 of the
ifrauind() function to verify that the current message is solicited before using this
function.
MSGCSYID() Returns the 1 - 3 digit decimal number system identification for DOM.
&MSGCSYID Note: The value is useful only for solicited messages. Examine bit 16 of the
ifrauind() function to verify that the current message is solicited before using this
function.
MSGDOMFL() Returns the 8-bit MVS DOM flags as a series of on (1) and off (0) EBCDIC
characters representing the bits in order. The following bit positions and meanings
&MSGDOMFL
are valid:
1
DOM by message ID
2
DOM by system ID
3
DOM by ASID
4
DOM by job step TCB
5
DOM by token
Note: The value is useful only for solicited messages. Examine bit 16 of the
ifrauind() function to verify that the current message is solicited before using this
function.
58 IBM Z NetView: Programming: REXX and the NetView Command List Language
Message Processing
Note: The value is useful only for solicited messages. Examine bit 16 of the
ifrauind() function to verify that the current message is solicited before using this
function.
MSGGDATE() Returns the message date in a 7-character format of yyyyddd, where yyyy is the
year and ddd indicates a calendar day.
&MSGGDATE
Note: This is not necessarily the current date. It might be the date with which MVS
associates the message as having been issued.
MSGGFGPA() Returns the 4-byte hexadecimal foreground presentation attributes. The following
bytes and meanings are valid:
&MSGGFGPA
1
Foreground control field
2
Foreground color field
3
Foreground highlighting field
4
Foreground intensity field
You can use one of the following forms to check for hexadecimal values:
REXX
Note: The value is useful only for solicited messages. Examine bit 16 of the
ifrauind() function to verify that the current message is solicited before using this
function.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 59
Message Processing
MSGGMID() Returns the 4-character hexadecimal value MVS message identifier field.
&MSGGMID
MSGGSEQ() Returns the 1 - 8 character numeric decimal sequence number. This function
represents the last three bytes of MSGGMID.
&MSGGSEQ
MSGGSYID() Returns the 1 - 3 character numeric decimal system identification. This is the first
byte of MSGGMID.
&MSGGSYID
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
&MSGGTIME
hundredths of seconds.
MSGID() REXX
&MSGID Returns the message identifier of the current message (see “Working with
Messages” on page 12 for a definition of current message.) This is the first
token, where tokens are determined by blanks. A reply ID, if present, is
ignored. If a reply ID is sent with the message, it is not used as the first token.
For a multiline write-to-operator (MLWTO) message, MSGID uses the first
token of the first line of the message. When an MSU buffer is being processed,
MSGID is equal to null ('').
Note: For messages received over the VM PROP/PMX interface, MSGID cannot
be set to the actual message identifier because of information added to the
front of the message.
NetView Command List Language
The difference from REXX is that &MSGID is used in NetView automation with
&WAIT.
60 IBM Z NetView: Programming: REXX and the NetView Command List Language
Message Processing
MSGORIGN() REXX
&MSGORIGIN Returns the domain where the last message read by MSGREAD originated.
MSGORIGN() is used for NetView automation with MSGREAD.
Refer to the NetView online help for more information about using functions
with MSGREAD.
NetView Command List Language
Specifies the domain where the message originated. &MSGORIGIN is used in
NetView automation with &WAIT.
See Chapter 5, “Automation Resource Management,” on page 95 for more
information about NetView automation.
See “Control and Parameter Variables Used with &WAIT” on page 135 for more
information about using control variables with &WAIT.
Note: The NetView command list language and REXX versions of this command are
spelled slightly differently; be sure to use the correct spelling when writing your
command list.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 61
Message Processing
MSGSTR() REXX
&MSGSTR Returns the message text of the current message (see “Working with
Messages” on page 12 for information about current message). MSGSTR() does
not include the message identifier—the token used by the MSGID() function.
For a multiline write-to-operator (MLWTO) message, MSGSTR() becomes the
message text of the first line of the message.
NetView Command List Language
Is the message text of the message most recently received by NetView
program. &MSGSTR does not include the message identifier (the token used by
the &MSGID control variable). &MSGSTR is used with &WAIT.
See “Control and Parameter Variables Used with &WAIT” on page 135 for more
information about using control variables with &WAIT.
MSGTOKEN() Returns a 1 - 10 digit decimal number that indicates the token associated with the
message.
&MSGTOKEN
Note: You can use a TOKEN value to group WTOs by setting MSGTOKEN before
issuing the WTO command. Later, these messages can be deleted using a single
DOM command by specifying the token value in MSGTOKEN.
62 IBM Z NetView: Programming: REXX and the NetView Command List Language
Message Processing
MSGVAR(n) Note: The use of MSGVAR is supported for compatibility purposes. Use MSGITEM
because the MSGVAR(n) functions do not return data relevant to the current
message as described in “Working with Messages” on page 12. Use the
MSGITEM(n) functions to return current message information.
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.
Refer to the NetView online help for more information about using functions with
MSGREAD.
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.
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
&MSGTYP
positions corresponds to the following values:
1
SESS — Corresponds to IFRAUWF1(14)
2
JOBNAMES — Corresponds to IFRAUWF1(9)
3
STATUS — Corresponds to IFRAUWF1(10)
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.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 63
Message Processing
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.
ROUTCDE() Returns the MVS routing code or codes assigned to the message. The value of the
field is a series of on (1) and off (0) EBCDIC characters representing the bits in
&ROUTCDE
order. The maximum number of ROUTCDEs assigned to a message is 128.
Note:
1. After the first 16 bits, the number of characters returned in ROUTCDE is the
lowest multiple of 8 that contains one or more on (1) characters. Therefore,
compare against a specific substring of ROUTCDE rather than against the entire
string.
For example, if only bit 17 is turned on, a string of 16 zeros, a 1, and 7 more
zeros are returned (000000000000000010000000). One method to test for bit
17 being on is shown in the REXX example in Figure 4 on page 65.
The functionally equivalent code written in NetView command list language is
shown in Figure 5 on page 65.
2. Another method to check for a specific bit is to use the REXX environment POS
(position) function, as shown in Figure 6 on page 65.
3. For details on using the REXX POS function, refer to the REXX library.
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 95 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.
64 IBM Z NetView: Programming: REXX and the NetView Command List Language
Command Processing
SYSCONID() Returns the MVS system console name associated with the message. System
console names are 2 - 8 characters in length.
&SYSCONID
Note: In the command revision environment, returns the console name under
which the command was issued.
SYSID() Returns the 1-8 character identifier of the MVS system from which a message
arrived.
&SYSID
Note: In the command revision environment, returns the system identifier under
which the command was issued.
ROUTCDE Examples
/* STANDARD COMPARE */
IF ROUTCDE() = '000000000000000010000000'
THEN SAY 'ROUTCDE BIT 17 IS SET.'
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 65
Command Processing
Table 9 on page 66 lists the arguments that you can specify and the values that are returned when you
use the RECEDATA function:
66 IBM Z NetView: Programming: REXX and the NetView Command List Language
MSU Information
Usage Note: If the RECEDATA function is started with an argument and the starting procedure is not
driven by a NETVONLY action, a REXX error is generated. Consider using the RECEDATA function initially
without an argument to check for a 0 value before performing any actions in the command revision
environment.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 67
MSU Information
Statistics-only RECMS
Some RECMS records contain only statistical data. The RECMS records that contain only statistical
data are those with recording mode (byte 8, 1-offset, into the RECMS) X'81', X'86', and X'87' (for X'87'
that represent temporary errors, not permanent errors).
Statistics-only RECFMS
Some RECFMS records contain only statistical data. The RECFMS records that contain only statistical
data are those with RECFMS types (byte 8, 1-offset, into the RECFMS) 1, 4, and 5.
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 (n) returns the name/type pair aaaaaaaa1111 that corresponds to n. If
no name/type pair corresponds to n, then a null value is returned.
3. HIER(n) returns null under the following conditions:
• If the command list is not run by the automation table
• If the automation table was not driven by an MSU
• If the MSU does not have a hardware monitor resource hierarchy
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.
5. If a complex link exists in a resource hierarchy, there might be resource levels
that are not 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 68 for more information about the HMCPLINK
function.
6. For information about the NetView built-in function &HIER, see “&HIER” on
page 119.
68 IBM Z NetView: Programming: REXX and the NetView Command List Language
MSU Information
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 69
MSU Information
HMEPNAU() HMEPNAU returns the NAU name of the entry point node where the MSU
originated for alerts forwarded using the NV-UNIQ/LUC alert forwarding protocol.
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 Z NetView Automation Guide for more information.
The maximum length is 9 characters.
HMEPNAU applies only to MSUs submitted to automation by the hardware
monitor. HMEPNAU returns null for all other MSUs.
See the example in “HMEPNAU, HMEPNET, and HMFWDSNA” on page 77.
70 IBM Z NetView: Programming: REXX and the NetView Command List Language
MSU Information
HMEPNETV() Returns a 0, 1, or null to indicate whether the entry point where the MSU originated
was a remote node NetView program. This function applies only to MSUs
forwarded using the SNA-MDS/LU 6.2 alert forwarding protocol.
1
The entry point was a NetView program.
0
The entry point was not a NetView program.
null
The MSU was not forwarded using the SNA-MDS/LU 6.2 alert forwarding
protocol.
Note:
1. Refer to the IBM Z NetView Automation Guide for more information about
forwarding mechanisms.
2. The maximum length is 1 character.
3. HMEPNETV applies only to MSUs submitted to automation by the hardware
monitor. HMEPNETV returns null for all other MSUs.
4. See the example in “HMEPNETV” on page 78.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 71
MSU Information
For a complete description of all event types, see the NetView online help
HMEVTYPE returns null if an MSUis one of the following types or is not submitted
to automation by the hardware monitor:
• A PD statistic (X'0025')
• A link configuration data (X'1332')
• A statistics-only RECMS
• A statistics-only RECFMS
The maximum length is 4 characters.
HMEVTYPE applies to all MSUs submitted to automation by the hardware monitor.
See the examples in “HMEVTYPE” on page 78.
HMFWDED() Returns a 0, 1, or null to indicate whether an MSU was forwarded from another
NetView node, where:
1
An MSU was forwarded from another NetView program through the NV-
UNIQ/LUC alert forwarding protocol.
0
An MSU was not forwarded from another NetView program, or was forwarded
using the SNA-MDS/LU 6.2 alert forwarding protocol. Examples of when a 0 is
returned include:
• Local MSUs received over the CNM interface
• Local MSUs received from the operating system
• MSUs received over the PPI
• MSUs received using the SNA-MDS/LU 6.2 alert forwarding protocol
Null
The MSU was not submitted to automation by the hardware monitor
RECMS and RECFMS records forwarded from an entry point NetView program to a
focal point NetView program by the LUC forwarding method are not submitted to
automation by the hardware monitor of the receiving focal point. These RECMS and
RECFMS records can be automated only by the sending entry point NetView
program.
Refer to the IBM Z NetView Automation Guide for more information about
forwarding mechanisms.
The maximum length is 1 character.
HMFWDED applies to all MSUs submitted to automation by the hardware monitor.
See the examples in “HMFWDED” on page 78.
72 IBM Z NetView: Programming: REXX and the NetView Command List Language
MSU Information
HMGENCAU() Returns the 1-character hexadecimal general cause code of an MSU. The general
cause code indicates both the general classification and exception condition that
caused the MSU to be created. For more details about general cause codes, refer
to the information about basic alert (X'91') alert MS subvectors in the SNA library.
HMGENCAU returns null if an MSU is one of the following types or is not submitted
to the automation table by the hardware monitor:
• A generic alert (X'0000')
• A link event (X'0001')
• A resolution (X'0002')
• A PD statistic (X'0025')
• A link configuration data (X'1332')
• A statistics-only RECMS
• A statistics-only RECFMS
Otherwise, a general cause code is returned.
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 maximum length is 1 hexadecimal character.
HMGENCAU applies to all MSUs submitted to automation by the hardware monitor.
See the examples in “HMGENCAU” on page 78.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 73
MSU Information
HMORIGIN() Returns the name of the resource sending the MSU. Any trailing blanks are
removed from the value returned.
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 Z NetView
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 descriptions of HMCPLINK and
HIER.
HMORGIN returns null if an MSU is not submitted to automation by the hardware
monitor.
The maximum length is 8 characters.
HMORIGIN applies to all MSUs submitted to automation by the hardware monitor.
See the examples in “HMORIGIN” on page 79.
HMSECREC() Returns 0, 1, or null to indicate whether the hardware monitor performs secondary
recording for an MSU, where:
1
Secondary recording is performed for an MSU at the resource level returned by
the HIER function. Foir more information, see the description of HIER.
0
Secondary recording is not performed for an MSU. HMSECREC always returns a
0 for PD statistics (X'0025') and frame relays (X'1332') because the hardware
monitor never performs secondary recording for these MSUs.
Null
The MSU was not submitted to automation by the hardware monitor.
The maximum length is 1 character.
HMSECREC applies to all MSUs submitted to automation by the hardware monitor.
See the examples in “HMSECREC” on page 79.
74 IBM Z NetView: Programming: REXX and the NetView Command List Language
MSU Information
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 75
MSU Information
MSUSEG(operands) Provides the parsing capability needed to extract information from a management
services unit (MSU) or other similarly designed pieces of data. Use this function in a
command list that is called by the NetView automation table or an LU6.2
application.
For complete MSUSEG syntax and some examples of usage, see “MSUSEG Syntax
and Examples” on page 79.
For information about the built-in function &MSUSEG, see “&MSUSEG” on page
121.
76 IBM Z NetView: Programming: REXX and the NetView Command List Language
MSU Information
HMASPRID
HMBLKACT
HMCPLINK
/*===================================================================*/
/* Example A: Was the MSU was forwarded from node NETA.CNM01 */
/* over LU 6.2? */
/*===================================================================*/
IF (HMFWDSNA() = '1') & , /* MSU forwarded over LU 6.2? */
(HMEPNET() = 'NETA') & , /* From network NETA? */
(HMEPNAU() = 'CNM01') THEN ... /* And nau CNM01? Then do ... */
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 77
MSU Information
HMEPNETV
/*===================================================================*/
/* Example A: Was the MSU was forwarded from a remote node */
/* entry point NetView over LU 6.2? */
/*===================================================================*/
IF HMEPNETV() = '1' THEN ...
HMEVTYPE
HMFWDED
HMGENCAU
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.
78 IBM Z NetView: Programming: REXX and the NetView Command List Language
MSU Information
/* Example B */
IF HMONMSU() = 0 THEN …
⋮
HMORIGIN
HMSECREC
HMSPECAU
HMUSRDAT
Syntax
The MSUSEG(operands) has the following syntax:
MSUSEG
.
( 1 )
MSUSEG ( ' id ' 1 )
H ( occ )
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 79
MSU Information
1
,
byte , length
where:
byte
Is the byte position into the lowest ID specified in id, counting from 1. 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 single
quotation marks when single quotation marks 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.
Note:
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 because of 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 79.
7. For more information about the automation table, refer to the IBM Z NetView Automation Guide. For
more information about vector definitions, refer to the SNA library. For more LU6.2 and MSU
information, refer to the IBM Z NetView Application Programmer's Guide.
8. For information about using the built-in function &MSUSEG in NetView command list language CLISTs,
see “&MSUSEG” on page 121.
80 IBM Z NetView: Programming: REXX and the NetView Command List Language
MSU Information
Examples
The following examples show MSUSEG() function usage.
In Figure 29 on page 81, 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 30 on page 81, Alert subvector A0 has 'LINE' followed by 'DOWN' anywhere in it. Literals can
be in hex and EBCDIC.
In Figure 31 on page 81, Alert subvector A1 has bits '01X01X00XX11XXXX', including unimportant bits,
starting from the first bit of the fourth byte.
Figure 32 on page 81 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.
Syntax
NPDABA has the following syntax:
NPDABA
NPDABA ( ' bbbaa ' )
where:
bbbaa
The 5-character string that defines the pre-generic alert:
• 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.
• aa is an associated hardware monitor action-code.
The action code is the specific alert ID within a block ID.
Note: The NPDABA function returns the associated hardware monitor probable-cause and error-
description text (maximum length of 48 characters).
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 81
Operator Information
Examples
The input is 6 characters, which is The input is not valid (not a valid hexadecimal number or not 5
not a valid length. characters in length).
The input is 5 characters, but is not a The hardware monitor does not recognize this combination of
valid block ID and action code. block ID (123) and action code (45).
82 IBM Z NetView: Programming: REXX and the NetView Command List Language
Session Information
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 83
Session Information
AUTCONID() Returns the MVS console identifier associated with this autotask. This association
was made using the AUTOTASK command with the CONSOLE keyword. The value
&AUTCONID
of AUTCONID is the console name of the MVS console where NetView commands
can be entered to run under this autotask.
AUTOTASK() Returns a single-character value of either 1 or 0 indicating whether the task is an
autotask. The following values are valid:
&AUTOTASK
1
An autotask
0
Not an autotask
CGI() Returns a single-character value of either 1 or 0. The following values are valid:
1
The procedure was called by the NetView web server.
0
The procedure was not called by the NetView web server.
CLOSING() Returns a value of 1 during post CLOSE command processing; otherwise a value of
0 is returned.
Use this function to identify commands that are scheduled to run using the
ENDCMD option for a pipe KEEP stage with the GLOBAL option.
CURCONID() Returns the MVS console identifier obtained by a NetView task. This console was
obtained with the GETCONID command or by issuing an MVS command. The value
&CURCONID
of CURCONID is the console name of the MVS console that this task uses to enter
MVS commands.
84 IBM Z NetView: Programming: REXX and the NetView Command List Language
Session Information
DISC() Returns a single-character value of either 1 or 0 that indicates whether the task is
disconnected. The following values can be returned
1
Autotask is disconnected.
0
Autotask is not disconnected.
DOMAIN('x') Returns the 1 - 5 character name of a NetView domain, where x is the following
value
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.12, ECVTPSEQ returns a value of
01011200.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 85
Session Information
JOBNAME(*) Returns the 1 - 8 character name of the name of the job under which the NetView
program is running. An asterisk (*) is the only parameter value allowed.
MVSLEVEL() Returns the version of MVS currently running. For example, if you are running z/OS
01.13.00, the function returns SP7.1.3.
&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 is assigned from the NETID statement in the CNMSTYLE member.
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
86 IBM Z NetView: Programming: REXX and the NetView Command List Language
Session Information
PANEL() Returns a single-character value of either 1 or 0. The following values are valid:
1
Panel commands can be issued.
0
Panel commands are not allowed.
PARTID() Returns the first two characters of the six-character prefix for VSE messages. The
two returned characters are the message partition ID only if the sending system
&PARTID
uses those characters to designate a partition ID for a message.
STCKGMT() Returns the current UTC mean time in store-clock format. This field is returned as
an 8-byte hexadecimal value.
&STCKGMT
SUPPCHAR() Returns the suppression character for your installation. (The suppression character
prevents the NetView program from writing the command out to the terminal,
&SUPPCHAR
hardcopy log, and network log.)
SUPPCHAR is a single character that you define in the CNMSTUSR or CxxSTGEN
member that is included in the CNMSTYLE member. The default suppression
character that is defined in these members is the question mark (X'6F').
If you do not define a suppression character in the CNMSTUSR or CxxSTGEN
member that is included in the CNMSTYLE member, SUPPCHAR defaults to X'3F'.
Note: The SUPPCHAR default character of X'3F' cannot be typed at the operator
console. Therefore, if you do not define a suppression character, the operator is
prevented from using one.
SYSPLEX() Returns the sysplex name found in the extended CVT field (ECVTSPLX).
&SYSPLEX
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 87
Session Information
88 IBM Z NetView: Programming: REXX and the NetView Command List Language
Session Information
TRAP() Returns a binary value that indicates whether a TRAP command will fail because of
a conflicting correlation environment. Values are:
1
TRAP command is acceptable.
0
TRAP command will fail with message DWO373E.
TYPE() Returns a 3-character string that indicates the level of the NetView program that is
installed. The following values are possible:
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.
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 89
REXX Environment and Terminal Information
WEEKDAYN() Returns a numeric value in the range of 1 -7 indicating the day of week (from
Monday through Sunday), as shown here:
&WEEKDAYN
1
Monday
2
Tuesday
3
Wednesday
4
Thursday
5
Friday
6
Saturday
7
Sunday
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
&RXDEFSTR
REXXSTOR 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
&RXOVRENV
not been overridden or is set to the default value, a null value is returned.
90 IBM Z NetView: Programming: REXX and the NetView Command List Language
Time and Date
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, and then you have the wrong time for the current date.
The following example shows some NetView command list language code that you can use to 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.
String Utility
You can use the following utility function in the NetView command list language:
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 91
Nulls and Blanks Stripping
92 IBM Z NetView: Programming: REXX and the NetView Command List Language
Nulls and Blanks Stripping
Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 93
Nulls and Blanks Stripping
94 IBM Z NetView: Programming: REXX and the NetView Command List Language
Advanced Topics
This chapter is intended to help you perform NetView automation using command lists.
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 more than one held message is on the NCCF screen, you might also add a LOCATE or TAKE stage. After
the PIPE HELDMSG command completes, yourcmd is running outside of pipelines, and functions such as
JOBNAME() and PIPE SAFE * in your procedure 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.
96 IBM Z NetView: Programming: REXX and the NetView Command List Language
Advanced Topics
If the MVS message processing facility is used to suppress a message with AUTO=YES coded and this
message is used to drive a command list, when the command list is driven and a WTO is issued, the WTO
is also suppressed. 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.
If automating a message that was marked non-displayable using a NetView Message Revision table or the
MVS message processing facility, then a message you create using the WTO will, by default, inherit that
non-displayable characteristic. You can control this behavior using the MCSFLAG variable. For example,
code MCSFLAG = '00000000'.
You can discover whether a message has been subject to Message Revision Table (MRT) action by using
the MRT edit order (see help for PIPE EDIT). When automating a message subject to the MRT, a message
you issue using the WTO command is not submitted to the MRT. However, you can control this behavior
using the MRT edit order as an output order.
If a multiline write-to-operator (MLWTO) message is used to drive a command list and a WTO is issued
from the command list, whether the WTO is displayed depends on the setting of the MLWTO line type
variable. If the setting of WTO is a single-line message, change the setting to a blank.
The REXX MLWTO line type variable is LINETYPE.
The NetView command list language MLWTO line type variable is &LINETYPE.
98 IBM Z NetView: Programming: REXX and the NetView Command List Language
Appendix A. Writing Simple Command Lists in the
NetView Command List Language
This chapter explains the basics of writing command lists for the Z NetView program using the NetView
command list language. This chapter also describes how variables, assignment statements, and built-in
functions fit together and how to combine them in command lists.
label CLIST
– Code the word CLIST beginning in column 2 or later. The word CLIST must be preceded by at least
one blank.
• Do not code the name of the command list on the first line unless accompanied by the word CLIST.
• Leave column 72 blank for all statements.
• Do not use columns 73-80. They are reserved for optional sequence numbers.
• Code at least one blank after a label (if one exists) or before a keyword.
• Code at least one blank between a control statement and the first operand.
• Separate operands with one or more blanks, or a single comma with no blanks.
• Code any number of leading or trailing blanks on your statements.
• Use lowercase letters only as comments or part of a message sent to the operator. In all other cases,
use uppercase for alphabetic characters A-Z.
• Code statements so that the maximum length is 32␠000 characters after variable substitution.
Note: To familiarize yourself with how variable substitution works, see “Variable Substitution Order” on
page 103.
• Code comment lines with an asterisk (*) as the first non-blank character of the command list line. Place
the comment after the asterisk. Comment lines cannot be coded on the first line of a command list.
• Code the command list so that it ends by processing the last command list statement, or by reaching an
&EXIT statement. An operator entering RESET also ends the command list.
• The hyphen causes Z NetView to keep all the blanks at the end of the line with the hyphen (up to but not
including column 72) and then fill the line to its end with characters from the beginning of the
continuation line. The hyphen is replaced by a blank. When filling a line with characters from the
100 IBM Z NetView: Programming: REXX and the NetView Command List Language
beginning of the continuation line, Z 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:
All the blanks from the P in KEEP to the B in BLANKS are kept. The first line writes 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 causes
the first four characters of the second line to be placed at the end of the first line. In the example, this is
two blanks and the letters BL. However, because the Z NetView program does not split a word across
lines of the output screen, the following message is displayed:
Appendix A. Writing Simple Command Lists in the NetView Command List Language 101
&CONTROL CMD
* COMMAND LIST UPDATED 2/5/19 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:
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 127.
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 Z NetView cannot find
the label, processing stops, and an error message is issued.
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, #, @, and $ are valid characters. 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, Z 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.
The following examples are labeled command list statements:
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 127.
Variables
Use variables 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:
• Parameter
• Control
102 IBM Z NetView: Programming: REXX and the NetView Command List Language
• User
• 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 143 for a description of global variables.
Code the variable as the first nonblank word in the command list.
A variable consists of an EBCDIC ampersand (&) followed by 1 - 11 characters. A - Z, 0 - 9, #, @, and $ are
valid characters.
&B = 1
&A&B = 2
Appendix A. Writing Simple Command Lists in the NetView Command List Language 103
Built-in functions
For more information, see “NetView Built-in Functions” on page 116.
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:
• Identified within the command list by a numbered position, for example, &1
• Entered following the command list name at run time
• Delimited by commas, apostrophes, or blanks
When you code your command list with parameter variables, use the following guidelines:
• You can use up to 31 parameter variables in a single command list.
• You can use the same parameter variables more than once in a command list.
• The value of a parameter variable can be 238 characters long.
• Parameter variables can contain either numeric or character values.
• When used in an arithmetic expression (for example, addition or subtraction), a parameter variable can
have a numeric 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.
Note: When IBM Z NetView receives a message coded in an &WAIT statement, some control variables are
set (for example, &MSGORIGIN, &MSGID, &MSGCNT, and &MSGSTR) and the values of the parameter
variables (&1 – &31) are changed to reflect the information in the received message.
See “Control Variables” on page 107 for information about these variables.
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 is 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 deactivate 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:
• &1 with ACT
104 IBM Z NetView: Programming: REXX and the NetView Command List Language
• &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.
If a command list is activated by a message, each word of the message becomes a separate parameter
variable. This is explained in more detail in Chapter 5, “Automation Resource Management,” on page 95.
V NET,&2,ID=&1
&1 is given the first value the operator enters, and &2 is given the second value.
If a command list statement has two or more parameter variables, the rightmost variable is changed first;
the scan then continues right to left and the next variable is replaced. You can use this method to change
the meaning of some of your parameter variables. If you must 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 107.
CALLEE LINES,TERMS,CDRMS
&A = 55
MINOR &A,&1,&2
Appendix A. Writing Simple Command Lists in the NetView Command List Language 105
Command list MINOR takes the value of &A (55) as its first parameter, the value of the first parameter of
MAJOR (ALPHA) as its second parameter, and the value of the second parameter of MAJOR (BETA) as its
third parameter.
If you must 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
The parameter variable on the nested command list call must be surrounded by quotation marks.
RESC ACT,'LU200,LOGMODE=S3270'
The parameter variables in the RESC command list contain the following values:
&1 = ACT
&2 = LU200,LOGMODE=S3270
Suppose you activated the RESC command list by entering this command:
RESC ACT,LU200,LOGMODE=S3270
&1 = ACT
&2 = LU200
&3 = LOGMODE=S3270
BGNSESS FLSCN,APPLID=&1,SRCLU=&2,LOGMODE=&3,INT=&4,D=&5
If you do not want to specify all the values, you can enter the following command:
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
106 IBM Z NetView: Programming: REXX and the NetView Command List Language
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 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, the correct values are assigned to each control variable. Use the LISTVAR command
to view the values of some of the control variables.
Note: A command list can create a user variable that has already been defined as a control statement,
control variable, or built-in function. However, if such a user variable is created, you cannot use the
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.
Assignment statements are explained in “Assignment Statements” on page 109.
The &PAUSE control statement halts the command list so that the operator can 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 114.
When you create user variables, observe the following rules:
• The first character must be an ampersand (&).
• The first character following the ampersand must be a letter or a symbol, not a number. Otherwise, it is
treated as a parameter variable.
• The ampersand must be followed by 1 to 11 characters. A - Z, 0 - 9, #, @, and $ are valid characters.
• The value of the user 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.
• A user variable can have a numeric value that is 255 digits long, including the sign. However, if the value
of the user variable is obtained using an arithmetic expression (for example, addition or subtraction), or
if the user variable is used in an arithmetic expression, the user variable can have a numeric value
between -2147483647 and 2147483647. The only characters you can use in a numeric value are 0-9.
The numeric value can be immediately preceded by a character indicating whether the value is positive
(+) or negative (-).
Note: A command list can create a user variable that has already been defined as a control statement,
control variable, or built-in function. However, you cannot use the provided control statement, control
variable, or built-in function anymore in the command list.
Table 18 on page 107 shows some examples of user variable names.
The following example shows how to manipulate user variables in assignment statements to set
parameters and to communicate with the operator.
Appendix A. Writing Simple Command Lists in the NetView Command List Language 107
&PAUSE VARS &ONE &TWO
&SUM = &ONE + &TWO
CLEAR
&WRITE >>> THE SUM OF &ONE + &TWO IS --->&SUM
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, then the number is prefixed with a zero (for example, X'2C6' is
converted to X'02C6' ). The maximum length of n is 255 hexadecimal digits.
The following examples show the use of hexadecimal notation:
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.
You can use comments to show the following information:
• When the command list was created and updated
• Who wrote the command list
• The function of the command list
• What input and output is expected
• Whether the command list depends on other programs or on other command lists.
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 102 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, the statement is ignored when the command list is run.
108 IBM Z NetView: Programming: REXX and the NetView Command List Language
Assignment Statements
Assignment statements give values to variables and do arithmetic operations within a command list. An
assignment statement has the following syntax:
assignment
& variable = expression
&VAR = 5
The constant cannot be longer than 255 characters. If it is a number, the constant must be between
-2147483647 and 2147483647. The only characters you can have in a numeric value are 0-9. The
numeric value can be immediately preceded by a character indicating whether the value is positive (+)
or negative (-).
Variable
A variable can be a parameter variable, control variable, user variable, or global variable.
The following assignment statement:
&PARMVAR = &4
&USERVAR = &OPID
Note: Using a control statement as a variable is not valid, even if the control statement is enclosed in
single quotation marks. For example, the following assignment statements are not valid:
&A = &IF
&A = '&WAIT ERROR'
Arithmetic operation
The addition and subtraction operations are allowed in an assignment statement. The format is two
numbers separated by a plus (+) or minus (-) sign. You can also use a variable that is to be set to a
number. The only characters you can use in a numeric value are 0-9. The numeric value can be
immediately preceded by a character indicating whether the value is positive (+) or negative (-).
Appendix A. Writing Simple Command Lists in the NetView Command List Language 109
The plus or minus sign must be separated from the numbers on each side by at least one blank unless
it indicates a positive or negative number (-2, -4). For example, both 4 - 2 and 4 - -2 are correct, but
4 -2 does not work.
The result of the arithmetic operation must be between -2147483647 and 2147483647. The
following assignment statement shows how you can use a control variable in an arithmetic operation:
&SUM = 38 - &PARMCNT
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 statement:
&C = &A + 1
Control Statements
Control statements are unique command list statements that control the way the Z NetView acts on other
statements in the command list. You can use the control statements in this chapter either for straight-line
coding or with the statements described in Appendix B, “NetView Command List Language Branching,” on
page 127 for conditional processing.
You can use control statements to change the sequential order of processing. Using command list control
statements, you can take the following actions:
• Send messages to the operator from the command list.
• Control the order in which commands are run.
• Ask the operator to enter information needed to continue the command list.
• 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.
Reading the descriptions of the control statements provides a general idea of the capability of these basic
statements. Read the sections that follow for details concerning each control statement.
The control statements follow:
&BEGWRITE
Writes a message or series of messages to the operator.
&CONTROL
Indicates the command list statements that are shown on the operator screen while the command list
is running.
110 IBM Z NetView: Programming: REXX and the NetView Command List Language
&PAUSE
Halts the command list until the operator enters information needed to continue the command list.
&WRITE
Writes a message to the designated operator.
&CONTROL Statement
The &CONTROL statement lets you indicate which command list statements are displayed at the operator
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 &CONTROL control statement has the following syntax:
&CONTROL
ALL
&CONTROL
CMD
ERR
where:
ALL
The ALL control statement displays all command list statements at the operator 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. After your command list is tested, the &CONTROL CMD
control statement or the &CONTROL ERR control statement is a better choice. When processing for
this command list is complete, the following message is displayed:
If you code the &CONTROL control statement without operands, or if you do not code the &CONTROL
control statement, the default control statement is &CONTROL ALL.
CMD
Displays all commands at the operator terminal. Each command is displayed just before it runs. The
other command list statements, such as comments, control statements, and other command list
language statement, are not displayed unless they contain an error. When processing for this
command list is complete, the DSI013I COMMAND LIST clistname COMPLETE message is
displayed.
ERR
Displays only statements that contain errors and commands that have nonzero return codes. If
&CONTROL ERR is in effect at the end of a command list, the DSI013I message is not displayed.
Appendix A. Writing Simple Command Lists in the NetView Command List Language 111
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.
The &WRITE statement and the &BEGWRITE statement 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 the &WRITE statement and the
&BEGWRITE statement
If you want to include blanks in front of the first character of the line, code a nonblank character after
&WRITE.
In the following line:
Otherwise, the line shifts left until the first nonblank character is in column 1.
The following line has no period:
The following example shows 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
Activating this command list by entering PATH HD3790N1 causes Figure 35 on page 112 to be displayed.
112 IBM Z NetView: Programming: REXX and the NetView Command List Language
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 36 on page 113 shows several &WRITE statements, which send one-line messages to the
operator.
CLEAR
&WRITE >>> THE SUM OF &ONE + &TWO IS --->&SUM
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 label cannot be found, the rest of the command
list statements are sent to the operator as comments and the command list is ended. If &BEGWRITE
has no label, 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, NOSUB is assumed.
SUB
Causes IBM Z NetView to carry out substitution on the message text before sending the messages to
the operator. See “Variable Substitution Order” on page 103 for information about how the variable
substitution is managed.
If blanks precede the first character on a message line, the line is shifted left until the first non-blank
character is in column 1. If you want the blanks sent to the operator screen, code a nonblank
character in column 1. If you are using &BEGWRITE to write a message containing double-byte
Appendix A. Writing Simple Command Lists in the NetView Command List Language 113
character set (DBCS) characters, you must use the SUB option. These coding rules are the same as
those for &WRITE.
Figure 37 on page 114 is an example of a &BEGWRITE statement with variable substitution.
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 38 on page 114 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.
114 IBM Z NetView: Programming: REXX and the NetView Command List Language
&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 is displayed 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.
Appendix A. Writing Simple Command Lists in the NetView Command List Language 115
Built-In Functions
messages.) If the command list is running in the command facility, the NCCF command has no effect.
Refer to the online help for more information about NetView commands.
The example writes a message to the operator prompting for the last name, first name, and middle initial
of the operator. 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.
If the operator enters the following command:
GO SMITH JOHN A
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.
116 IBM Z NetView: Programming: REXX and the NetView Command List Language
Built-In Functions
• &SUBSTR
The examples in this section use built-in functions in assignment statements. Examples with built-in
functions in the &IF control statement are in “&IF Control Statement” on page 127.
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.
The &BITAND function has the following syntax:
&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.
The following two examples show the &BITAND operation:
&BITAND X'73' X'27' results in X'23'
&BITAND X'13' X'5555' results in X'1155'
Usage :
1. If string2 is null, the result is string1 unchanged.
2. If you specify more than two strings, 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.
&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.
The &BITOR function has the following syntax:
&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.
Appendix A. Writing Simple Command Lists in the NetView Command List Language 117
Built-In Functions
&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.
The &BITXOR function has the following syntax:
&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.
The following two examples show the &BITXOR operation:
&BITXOR X'12' X'22' results in X'30'
&BITXOR X'1211' X'22' results in X'3011'
Usage :
1. If string2 is null, the result is string1 unchanged.
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.
&CONCAT
The &CONCAT function concatenates the values of two variables, two constants, or a variable and a
constant to form a new value. The &CONCAT built-in function has the following syntax:
&CONCAT
&CONCAT variable variable
constant constant
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.
For example, suppose you had the following statement:
118 IBM Z NetView: Programming: REXX and the NetView Command List Language
Built-In Functions
&PREFIX = SN/
&ID = 5497
&SERIAL = &CONCAT &PREFIX &ID
After processing, the user variables are set in the following way:
&PREFIX
SN/
&ID
5497
&SERIAL
SN/5497
Note: When &CONCAT is used to concatenate two double-byte character set (DBCS) strings, it removes
adjacent shift-in (SI) and shift-out (SO) characters.
&HIER
The &HIER function provides user access to the NetView hardware monitor hierarchy data associated
with an MSU.
&HIER has the following syntax:
HIER
&HIER
n
where:
n
Specifies the index number (1 - 5) of a specific name/type pair.
Note:
1. &HIER without n returns a resource hierarchy slightly different from 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 no name/
type pair corresponds to n, then a null value is returned.
3. &HIER returns null under the following conditions:
• If the command list is not run by the automation table
• If the automation table was not driven by an MSU
• If the MSU does not have a hardware monitor resource hierarchy
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 39 on page 120.
5. If a complex link exists in a resource hierarchy, resource levels that are not displayed in the
information returned by the &HIER function might exist. You must use a system schematic to
determine the complete hierarchy configuration when a complex link is present.
Appendix A. Writing Simple Command Lists in the NetView Command List Language 119
Built-In Functions
*
* 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. &LENGTH has the following syntax:
120 IBM Z NetView: Programming: REXX and the NetView Command List Language
Built-In Functions
&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.
The following example shows how to use &LENGTH. Suppose you called command list SAMP by entering
SAMP LU2525. Assume the name of the hardcopy printer (&HCOPY) control variable is HC55.
SAMP CLIST
&HCLENGTH = &LENGTH &HCOPY
&RESLEN = &LENGTH &1
&MSUSEG
The &MSUSEG function provides the parsing capability needed to extract information from a management
services unit (MSU) or other similarly designed pieces of data. Use this function in a command list that is
called by the NetView automation table or an LU6.2 application.
The &MSUSEG function has the following syntax:
&MSUSEG
.
( 1 )
&MSUSEG id
H ( occ )
1
,
byte , length
where:
byte
The byte position into the lowest ID specified in id, counting from 1. 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)
Appendix A. Writing Simple Command Lists in the NetView Command List Language 121
Built-In Functions
level. You can code the H in uppercase or lowercase. You can place H inside or outside of the single
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). 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 that is specified on the left side.
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.
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.
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.
If the byte position is beyond the end of the location, a null value is returned.
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 Z NetView Automation Guide. For more
information about vector definitions, refer to the SNA library. For more LU6.2 and MSU information, refer
to the IBM Z NetView 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 the
CNMSTUSR or CxxSTGEN that is included in the CNMSTYLE member. 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 Z NetView Administration
Reference.
NCCFID has the following syntax:
&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.
122 IBM Z NetView: Programming: REXX and the NetView Command List Language
Built-In Functions
&DOM1 = &NCCFID 1
&DOM2 = &NCCFID 2
&DOM3 = &NCCFID 3
START DOMAIN=&DOM1
START DOMAIN=&DOM2
START DOMAIN=&DOM3
Assume that your operator profile defines three domains with which you can establish cross-domain
sessions:
1
ALPHA
2
BETA
3
GAMMA
After processing, the user variables are set in the following way:
&DOM1
ALPHA
&DOM2
BETA
&DOM3
GAMMA
The three domains are then started with the START command.
In this example, the operator must know that three domains 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. &NCCFSTAT has the following syntax:
&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
Appendix A. Writing Simple Command Lists in the NetView Command List Language 123
Built-In Functions
&STATUS
ACT|INACT
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 127).
If NCCFA is inactive, the command list starts it. If NCCFA is active, you receive the following message:
&SUBSTR
The &SUBSTR function returns the specified portion of an input variable by parsing the variable, starting
at position start for length characters. &SUBSTR has the following syntax:
&SUBSTR
&SUBSTR variable start
length
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.
For example, suppose you have the following statements:
&HOLD = ACF/VTAM
&FIRST = &SUBSTR &HOLD 1 3
&SECOND = &SUBSTR &HOLD 5 4
&THIRD = &SUBSTR &HOLD 6
After processing, the user variables are set in the following way:
&HOLD
ACF/VTAM
&FIRST
ACF
&SECOND
VTAM
&THIRD
TAM
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
124 IBM Z NetView: Programming: REXX and the NetView Command List Language
Built-In Functions
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. Substrings are never padded with blanks. If
you specify a length that is too long, no length is assumed and the entire string beginning at the starting
position is used. If the length is 0, or the starting position is beyond the variable length, the result of
&SUBSTR is null.
Figure 40 on page 125 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 in the following way:
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.
The following example shows the &SUBSTR statement used on a double-byte character and Latin
character string:
&DBCS = 'AB<D1D2D3>EFG'
where:
• A, B, E, F, G are Latin characters.
• < (X'0E') represents the shift-out control character.
• > (X'0F') is the shift-in control character.
• D1, D2, D3 are double-byte characters.
Using this value, &SUBSTR works in the following way:
Appendix A. Writing Simple Command Lists in the NetView Command List Language 125
Built-In Functions
Note: The DBCS delimiters are 1 byte long; the DBCS codes are 2 bytes long.
126 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Branching
This chapter describes the conditional and unconditional branching statements in the NetView command
list language.
• The &IF statement causes a conditional branch based on logical or arithmetical comparisons. The result
of a test or comparison in an &IF statement determines the alternative to perform. Conditional
processing statements give you the flexibility to code if-then and loop structures.
• The &GOTO statement causes unconditional branching.
• The &EXIT statement lets you code logical exit points within a command list.
• The &WAIT statement suspends processing and waits for the completion of an event.
GT
<=
LE
>=
GE
¬>
NG
¬<
NL
statement
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 109.
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.
The following example shows comparisons:
5 = &A
&1 = '
2 + 2 NE &ANSWER
&PARMCNT LE 5
If a variable used in an arithmetic expression can be equal to null, then use the following syntax:
7 > 3 + 0&1
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 is equal to 9, the expression 3 + 09 is compared to 7.
The following five examples use the &IF control statement:
128 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Branching
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 102 for more information about labels.
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 act based on the return code. See “Command List
Information” on page 38 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
no &EXIT statement exists, a zero return code is set.
Figure 41 on page 130 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 you enter STOPTAF FLSCN, the following message is displayed:
130 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Branching
&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 132.
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
137.
The only messages checked are those that are intended for the operator screen. If you code the
DSIEX02A exit routine (output to the operator), the &WAIT control statement might not set the message
for matching. For example, if the DSIEX02A exit routine deletes the message, the &WAIT control
statement 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, wait only for messages that are displayed on
the NetView console.
When coding the &WAIT command control statement, it is important to code an event=-label pair for the
DSI210I message and the *NN event. 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 need to notify the operator of the error and exit the
command list.
The W that signifies wait state, if present, remains in the upper right corner of the panel while this initial
&WAIT command is processed. The W indicates 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 the
DSI016I NOT IN PAUSE OR WAIT STATUS message. 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 is no longer displayed in the upper right corner of the panel.
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
137.
132 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Branching
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 that 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, can
cause a loop or other unwanted results. Therefore, use the *=-label condition with caution.
If you specify a token that contains a special character such as a comma, period, asterisk, or most
other non-numeric and non-alphabetic characters, use the DOMAIN.TOKEN format. The NetView
program does not accept single quotation marks ('), commas (,), or blanks when you specify a token
because these characters are reserved as NetView default delimiters. If the token contains the
ampersand (&) then &CONCAT must be used to concatenate the ampersand with the rest of the
token.
Figure 42 on page 133 shows examples of coding tokens that contain special characters:
&WAIT DOMAIN1.*HASP=-MSG1
&WAIT DOMAIN1.=HASP=-MSG1
&X = &CONCAT & HASP
&WAIT DOMAIN1.&X=-MSG1
Multiline messages such as multiline write-to-operators (MLWTOs) are treated as one message.
Therefore, only the message identifier of the first message in a multiline message is available to the
&WAIT, and the &WAIT statement can be satisfied only by that message identifier. Use GETMSIZE,
GETMTYPE, GETMLINE, GETMPRES, and GETMTFLG to access the other lines of a multiline message.
Refer to these commands in the NetView online help for more information about multiline messages
and an example of using &WAIT with multiline messages.
Note:
1. When using a token event, messages not related to the command issued by the &WAIT statement
can be matched to the event and, depending on the options on the &WAIT statement, can be
suppressed. However, use caution when coding * or *.* with SUPPRESS when specifying a domain
identifier or token. If the command list is suspended and the SUPPRESS option is in effect on the
&WAIT statement, any messages the task receives are suppressed before the command list is
resumed.
2. Because NetView-NetView tasks (NNTs), PPT, OSTs, and autotasks do not process any commands
or messages queued to the low priority queue of a task that is running any command (assembler
command or HLL, REXX or NetView command list language command procedure), only messages
that are queued to the high or normal priority queue of a waiting task are checked for matches to
satisfy a wait condition.
3. Usually, messages queued to tasks through assign…copy= processing can satisfy an outstanding
&WAIT. However, a message is not sent to the waiting task through assign…copy= processing if
the message contains a message automation table entry specifying DISPLAY(N). The assign…
copy= processing requires a displayed message, but DISPLAY(N) specifies no display, which
prevents that processing. The message is not passed on; therefore, it cannot satisfy the &WAIT
condition.
For more information about message flow, refer to the IBM Z NetView Automation Guide book.
*ERROR
This event occurs when the command specified on the &WAIT statement returns a nonzero return
code. If you do not code *ERROR, the NetView program continues to wait for the messages associated
with this command even if the command ends with an error. If the NetView program is waiting for a
message that says the command was successful, the operators running this command list are delayed
until someone issues GO or RESET. If *ERROR is satisfied, the message control variables are set in the
following way:
&MSGID
*ERROR
&MSGORIGIN
Name of domain where the command list is running
&MSGSTR
Null
&MSGCNT
0
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 1 - 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 must 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. 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.
134 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Branching
Ending an &WAIT
An &WAIT statement can end in one of the following ways:
• 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.
• The operator enters the RESET command. The command list and all of its nested command lists end.
• 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.
• 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.
• Receipt of a message matching an event=-label pair. The command list continues processing with the
statement marked with the label.
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.
For more information, see “Message Processing Information Functions” on page 48.
The following example shows 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
Note:
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.
136 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Branching
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 screen. If an &WAIT CONTINUE statement is encountered after a MSGID=-label is matched,
and no other statement ends the command list or the &WAIT, the command list loops.
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 a &WAIT statement 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, and
indicates that the wait ends after the first event that satisfies the &WAIT. Although the ENDWAIT
specification 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 to continue after event processing is finished, code &WAIT CONTINUE. It is
similar to branching back into the &WAIT statement.
Note:
1. If neither DISPLAY nor SUPPRESS is specified, then either ENDWAIT or CONTWAIT must be specified.
2. DISPLAY is the default only if ENDWAIT or CONTWAIT is specified and SUPPRESS is not specified. See
Table 19 on page 138 for valid option combinations.
3. The DISPLAY and SUPPRESS options can be changed at any point in a command list. After messages
are suppressed, you must code another &WAIT statement with the DISPLAY operand to begin
displaying messages again.
4. &WAIT SUPPRESS overrides DISPLAY because the command list has been given the message and
does not issue an echo.
5. When SUPPRESS is in effect, you do not know whether messages are received. Therefore, all of the
messages might not be processed when an operator issues a GO or RESET command to end an
&WAIT.
6. If neither ENDWAIT nor CONTWAIT is specified, then either DISPLAY or SUPPRESS must be specified.
7. ENDWAIT is the default only if DISPLAY or SUPPRESS is specified and CONTWAIT is not specified. See
Table 19 on page 138 for valid option combinations.
8. The ENDWAIT and CONTWAIT options can be changed at any point in a command list. After
CONTWAIT starts, you must code another &WAIT statement with the ENDWAIT operand to return to
the default value.
138 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Branching
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.
If you update this statement using SUPPRESS, CONTWAIT, or CONTINUE, the new settings remain in
effect for the rest of the &WAIT statements in the command list, including an &WAIT currently in process.
To reinstate the initial settings, you must code another &WAIT statement with the appropriate operands.
If you 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.
Because &WAIT CONTWAIT queues NetView messages, 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.
140 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Branching
&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:
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.
Upon successful activation of NODE1, the message text shown in Figure 44 on page 141 is displayed on
the operator terminal:
ACTONE NODE1
IST097I VARY ACCEPTED
VTAM MESSAGE IST093I WAS RECEIVED
NODE1 IS NOW ACTIVE
COMMAND LIST ACTONE COMPLETE
142 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Global Variables
This chapter describes the use of global variables in the NetView command list language. Global variables
enable values to be defined, referenced, and updated by different operators. Values are passed to a
command list for updates, and the updated values can then be referenced by other command lists. For
example, command list CLISTA can assign a value to a task global variable, &VAR1, and then activate its
nested command list, CLISTB. The nested command list, CLISTB, can check the value assigned to &VAR1
by CLISTA, update the value, and return control to CLISTA. The original command list, CLISTA, now has
access to the value assigned to &VAR1 by CLISTB.
The two types of global variables are task and common.
Task global variables can be defined, referenced, and updated by any command list running under a
particular task. Task global variables can be referenced only 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.
The NetView program provides two methods to access global variables:
• You can use &TGLOBAL, &CGLOBAL, and GLOBALV DEF to provide direct reference to global variables.
• You can use the GLOBALV GET and PUT commands to copy and replace global variable values.
Refer to the NetView online help for more information about the GLOBALV command.
Note:
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 each command provides function, use only one or the other within a single
NetView command list.
2. When you create global variables, the variable can be 1 - 11 characters in length. A - Z, 0 - 9, #, @, and
$ are 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 numeric value between -2147483647 and 2147483647. Numeric
values outside these limits are treated as character strings.
You need two &s when referencing a global variable indirectly. See “Using Parameter Variables in a
Command List” on page 105 and “Variable Substitution Order” on page 103 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.
The following example shows using the &TGLOBAL control statement:
&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 in the following way:
• ABC becomes task global variable &ABC. The value of &ABC is null because a value was not defined.
• 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 146 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.
Note the following suggestions for using task global variables:
• The PROFILE IC can set task global variables to indicate a message suppression level or message
compression that is different for different types of operators. Command lists driven by various
messages can test these variables to determine what information that a particular operator needs.
• Any command list can set up and initialize any number of parameters for another command list running
under the same operator task. This improves nested command list communication because task global
variables can return information from a nested command list.
&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
144 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language Global Variables
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.
An example using the &CGLOBAL control statement follows:
&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:
• ABC becomes common global variable &ABC. The value of &ABC is null because a value is not defined.
• &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.
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.
To prevent a common global variable from being updated by different command lists at the same time,
you can have all command lists that update the variable run under the same task. See “Extent of Variables
When Using &TGLOBAL and &CGLOBAL” on page 146 for information about the interaction of common
global variables with user variables and task global variables.
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 command lists UPDCGLOB and SETCGLOB command lists supplied with the NetView
product 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 45. CLIST1 Command List to Define, Update, and Reference Task Global Variables
CLIST1 in Figure 45 on page 145 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 46 on page 146 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.
146 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView Command List Language 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 is used to define, put, and get global variables in NetView command list language
command lists. The GLOBALV command also saves 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 about the GLOBALV command.
148 IBM Z NetView: Programming: REXX and the NetView Command List Language
Appendix D. Comparison of REXX and NetView
Command List Language
This appendix provides a brief comparison between REXX and the NetView command list language.
Table 20 on page 149 shows each control statement used in the NetView command list language and
provides the equivalent REXX instruction. The table is in alphabetic order based on the name of the
NetView command list language control statement.
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.
Instructions provided by the NetView program can be used only with the IBM Z NetView program. These
instructions are not supported by the REXX interpreter and cannot be used in REXX execs run in a non-
NetView environment.
Table 20. Comparison of REXX Instructions and NetView Command List Language Control Statements
REXX Instruction Described on NetView Control Described on REXX
Statement Instruction
Provided By
None N/A &BEGWRITE “&BEGWRITE N/A
Control
Statement” on
page 113
CGLOBAL(name) “Global &CGLOBAL “&CGLOBAL” on NetView
Variable page 144
Information
Functions” on
page 48
TRACE “Tracing &CONTROL “&CONTROL REXX
REXX Statement” on
Command page 111
Lists” on page
26
EXIT “&EXIT &EXIT “&EXIT Control REXX
Control Statement” on
Statement” page 129
on page 129
SIGNAL “Return &GOTO “&GOTO Control REXX
Codes in Statement” on
REXX page 129
Command
Lists” on page
27
Table 21 on page 151 shows the various control variables and functions used in the NetView command
list language and the equivalent REXX functions.
If the function is provided by the NetView program, it can be used only with the NetView program and is
not supported by SAA REXX.
150 IBM Z NetView: Programming: REXX and the NetView Command List Language
Table 21. Comparison of REXX Functions and NetView Command List Language Control Variables and
Functions
152 IBM Z NetView: Programming: REXX and the NetView Command List Language
Table 21. Comparison of REXX Functions and NetView Command List Language Control Variables and
Functions (continued)
154 IBM Z NetView: Programming: REXX and the NetView Command List Language
Table 21. Comparison of REXX Functions and NetView Command List Language Control Variables and
Functions (continued)
156 IBM Z NetView: Programming: REXX and the NetView Command List Language
Table 21. Comparison of REXX Functions and NetView Command List Language Control Variables and
Functions (continued)
158 IBM Z NetView: Programming: REXX and the NetView Command List Language
Table 21. Comparison of REXX Functions and NetView Command List Language Control Variables and
Functions (continued)
160 IBM Z NetView: Programming: REXX and the NetView Command List Language
Table 21. Comparison of REXX Functions and NetView Command List Language Control Variables and
Functions (continued)
162 IBM Z NetView: Programming: REXX and the NetView Command List Language
Table 21. Comparison of REXX Functions and NetView Command List Language Control Variables and
Functions (continued)
Table 21. Comparison of REXX Functions and NetView Command List Language Control Variables and
Functions (continued)
164 IBM Z NetView: Programming: REXX and the NetView Command List Language
Command List Commands
• FLUSHQ
• GETMPRES
• GETMSIZE
• GETMTFLG
• GETMTYPE
• GLOBALV
• MSGREAD
• MSGROUTE
• PARSEL2R
• SDOMAIN (with QUIET option)
• TRAP
• WAIT
• WTO
• WTOR
Note: The FLUSHQ, MSGREAD, TRAP, and WAIT commands 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.
166 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Examples Index
This appendix contains reference tables for the REXX and NetView command list examples contained in
this book. Entries in the tables are listed in alphabetic order.
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.
168 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
This section contains examples of REXX command lists written for the NetView program. These examples
show how you can use the instructions and functions provided by the NetView program and the standard
REXX instructions and functions together in REXX command lists running in a NetView environment.
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? */
ACTLU Example
/* ACTLU COMMAND LIST - REXX VERSION */
/* FUNCTION : TO ACTIVATE A VTAM NODE. */
/* INPUT : 1 PARAMETER, THE NAME OF THE NODE. */
/**********************************************************************/
IF MSGVAR(1) = '' THEN /* NO FIRST PARAMETER ? */
DO /* THEN ISSUE REQUEST */
SAY 'PLEASE ENTER "GO NODENAME"',/* REQUEST NODENAME FROM USER */
'OR "GO STOP" TO CONTINUE' /* OR, ALLOW USER TO STOP CLIST */
PARSE PULL NODE /* NODE = NODENAME OR STOP */
END /* THEN ISSUE REQUEST */
ELSE /* FIRST PARAMETER EXISTS */
NODE = MSGVAR(1) /* ASSUME IT IS A NODE NAME */
/* IF NODE='STOP' CLIST ENDS */
IF NODE¬='STOP' THEN /* DID USER CHOOSE TO STOP ? */
DO /* PROCESS NODENAME */
'TRAP AND SUPPRESS ONLY MESSAGES IST* ' /* TRAP ALL VTAM MSGS */
'V NET,ACT,ID='NODE /* ISSUE VTAM ACTIVATE FOR NODE */
IF RC=0 THEN /* VALID NODE NAME ? */
DO /* YES, RETURN CODE = 0 */
'WAIT 30 SECONDS FOR MESSAGES' /* WAIT FOR 30 SECONDS */
IF EVENT()='M' THEN /* OUT OF WAIT - IS THERE A MSG? */
DO /* PROCESS TRAPPED MESSAGE */
'MSGREAD' /* READ IN 1ST MESSAGE */
DO WHILE (RC=0) /* IF RC¬=0 THEN NO MORE MSGS */
SELECT /* DETERMINE WHICH MESSAGE HIT */
WHEN (MSGID() = 'IST061I') /* NODE NOT FOUND */
THEN SAY '==> LU UNKNOWN ', /* INFORM USER */
'TO YOUR VTAM <=='
WHEN (MSGID() = 'IST093I') /* NODE NOW ACTIVE */
THEN SAY '==> TERMINAL ', /* INFORM USER */
MSGVAR(1)' NOW ',
MSGVAR(2) '<=='
OTHERWISE /* IGNORE THE VTAM MESSAGE */
'WAIT CONTINUE' /* CONTINUE WAITING */
END /* OF SELECT FOR IST061I/IST093I */
'MSGREAD' /* READ IN THE NEXT MESSAGE */
END /* DO WHILE RC=0, LOOP BACK */
END /* PROCESS TRAPPED MESSAGE DO */
/* OUT OF DO WHILE, CHECK FOR
ERROR OR TIME-OUT EVENTS */
SELECT /* CHECK RESULT OF THE WAIT */
WHEN (EVENT()='E') THEN /* ERROR ENCOUNTERED ? */
SAY 'ERROR PROCESSING ', /* INFORM USER */
'ACTIVATE COMMAND'
WHEN (EVENT()='T') THEN /* WAIT TIME-OUT ENCOUNTERED? */
SAY 'NO RESPONSE TO ', /* INFORM USER */
'ACTLU CLIST FOR 'NODE
OTHERWISE /* NO-OP */
END /* OF SELECT FOR ERROR/TIME-OUT */
END /* IF RC=0 (VALID NODENAME) */
END /* IF NODE¬='STOP' PROCESSING */
EXIT
170 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
CHKOPNUM Example
The following example 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 */
/* ----------- -------- ------------------------------------------ */
/* */
/**********************************************************************/
SIGNAL ON ERROR
PARSE ARG OPTION
'GLOBALV GETC CHKOPTIMES, CHKOPNUM, CHKOPMAX'
IF OPTION = 'DISPLAY' THEN DO;
EXIT 0;
CHKRSTAT Example
The following example 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
172 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
VARNAME = RESNAME∥'@A'
'GLOBALV GETC 'VARNAME
INTERPRET 'ACT# ='VARNAME
IF DATATYPE(ACT#) ¬= 'NUM' THEN
ACT# = 1 /* IF NONNUMERIC */
ELSE
ACT# = ACT# + 1
INTERPRET VARNAME'=ACT#'
'GLOBALV PUTC 'VARNAME
END
/* IF THE CURRENT STATE IS NOT ACTIVE OR ACTIVE W/SESSION, THEN GET */
/* INCREMENT AND UPDATE THE COMMON GLOBAL VARIABLE WITH THE NAME */
/* 'RESOURCE NAME' CONCATENATED WITH '@NA'. NOTE THAT SINCE THE */
/* GLOBALV COMMAND REQUIRES THE VARIABLE NAME, A VARIABLE HAS */
/* TO BE SET TO THE VARIABLE NAME, SINCE IT IS DYNAMICALLY */
/* CONSTRUCTED. THE REXX INTERPRET INSTRUCTION MUST ALSO BE USED */
/* TO PERFORM OPERATIONS ON THE DYNAMICALLY CONSTRUCTED VARIABLE */
ELSE DO
VARNAME = RESNAME∥'@NA'
'GLOBALV GETC 'VARNAME
INTERPRET 'NACT# ='VARNAME
IF DATATYPE(NACT#) ¬= 'NUM' THEN
NACT# = 1 /* IF NONNUMERIC */
ELSE
NACT# = NACT# + 1
INTERPRET VARNAME'=NACT#'
'GLOBALV PUTC 'VARNAME
END
EXIT 0;
ERROR: SAY 'ERROR OCCURRED. RETURN CODE IS ' RC
EXIT -1; /* END COMMAND LIST FOR ERROR */
CNMS1101
The following is an example of PPI communication and of full screen automation.
/**********************************************************************/
/* ---------------- The Purpose of this Sample ------------------ */
/* This is a compilation of "examples" given in the Customization: */
/* Pipelines book and elsewhere, related to NetView Pipelines. The */
/* sample is intended only to save you the effort of typing in */
/* examples in order to try them. */
/* */
/* You can run these example directly from CNMS1101, if desired, by */
/* doing this: */
/* 1 Copy CNMS1100 into the concatenation under DSICLD */
/* 2 Invoke it with one or more numbers to indicate the example(s) */
/* you wish to run. */
/* */
/**********************************************************************/
SIGNAL ON HALT
sep = '08'X; endc = '09'X; delim = '0A'X
/* It is often helpful to use non-printable characters for the */
/* various delimters in our pipeline specifications. This */
/* reduces the chance that some character in the data will */
/* cause a conflict. */
arg functions
IF functions = '' THEN
DO;
address netvasis,
'PIPE (NAME FUNLIST END \)',
'| STEM EX.',
'| CM: NLOC 1.1 / /',
'| COUNT EACHLINE',
'| COLOR WHITE',
'| EDIT LINECOUNT 1 1.* NEXTWORD',
'| T: FANINANY',
'| A: COLLECT',
'| CONSOLE ONLY',
'\ LITERAL /Functions supported are.../',
'| COLOR PINK',
'| A:',
'\ CM:',
'| COLOR BLUE',
'| T:'
END;
ELSE
DO
parse var functions step funcArgs
SELECT
WHEN (¬datatype(step,'W')) THEN
say 'Function codes must be numeric'
WHEN (step=1) THEN CALL PATLIST funcArgs
WHEN (step=2) THEN CALL ShowALH funcArgs
WHEN (step=3) THEN CALL MAPCL funcArgs
WHEN (step=4) THEN CALL DALspread funcArgs
WHEN (step=5) THEN CALL TasksOut funcArgs
WHEN (step=6) THEN CALL PickData funcArgs
WHEN (step=7) THEN CALL Responder funcArgs
WHEN (step=8) THEN CALL Requestor funcArgs
WHEN (step=9) THEN CALL NewFile funcArgs
WHEN (step=10) THEN CALL EndMe funcArgs
WHEN (step=11) THEN CALL MakeAlert funcArgs
WHEN (step=12) THEN CALL resDyn funcArgs
WHEN (step=13) THEN CALL presDyn funcArgs
OTHERWISE
say 'Function number' step 'out of range.'
END
END
EXIT
174 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
RETURN 0
address NETVASIS,
'PIPE (NAME TASKLIST END \)',/* */
'| NETV LIST STATUS=TASKS', /* issuing the synchronous command */
'| DROP LAST 1', /* throw out "END OF ..." */
'| COLOR GREEN', /* nice color for the data lines */
'| EDIT WORD 2 1', /* getting "type" value; it's first */
'19.8 8', /* at char 19, taskid begins; put in col 8*/
'38.8 19', /* at char 38, find resource; move to 19 */
'55.* 35', /* at char 55, find status; move to col 35*/
'| LABS: COLLECT', /* everything gets collected here */
'|CONS ONLY',
, /* ------------- end of simple pipeline 1 ---------- */
, /* It's a little weird, but the stuff below here */
, /* is absorbed by COLLECT before the data lines */
, /* we worked on above. */
'\ FAN: FANIN', /* stuff from below brought together here,*/
'| LABS:', /* IN ORDER, and then sent upstream */
, /* ---------- end of VERY simple pipeline 2 -------- */
'\ LIT !Status of NetView Tasks!', /* first label line is */
'| COLOR YEL', /* made yellow and passed up */
'| FAN:', /* to FANIN's first input! */
"\ LIT !Task Task's Taskname or Current!", /* second label */
'| COLOR PINK', /* is pink and goes to FANIN's*/
'| FAN:', /* second output, etc. */
"\ LIT !type ID Resource Status!",
'| COLOR PINK',
'| FAN:'
/* Notice how the colored label lines remain fixed to the top */
/* both on the NCCF screen and in WINDOW. */
RETURN RC
176 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
address NETVASIS,
'PIPE (NAME PPIW1101 END ;)',
'|A: PPI PPIS1101', /* PPI as receiver, RC -> A: */
'| WAIT *', /* wait "forever" */
'| COUNT EACHMSG', /* counting requests */
'| COLOR RED REV', /* */
'| EDIT "TC" LINETYPE /Your''s is request/ 1',
'MSGCOUNT NW',
'WL', /* build "stuff" onto his */
'"TL" LINETYPE', /* request to make our */
'/label line / 1', /* response */
'WL',
'1.* 1',
'| EDIT COPY * /last line/ NW', /* more "stuff" */
'| COLLECT MAX 1', /* fixup line types, ?? */
'|B: PPI (NV) *', /* rtrn answer to sender, NV */
'| EDIT /Response sent to/ 1 ', /* report what we did */
'IFRAUSDR NW',
'|CONS',
';A:',
'|NLOCATE 1.11 /+0000000000/',
'|COLOR WHI',
'|EDIT /Error code from receive:/ 1',
'1.* NW',
'| CONS',
';B:',
'| NLOCATE 1.11 /+0000000000/',
'| COLOR YEL',
'| EDIT /Error code from send:/ 1',
'1.* NW',
'| CONS',
'; LIT /CNMS1101 7 ready to respond to requests./',
'| CONS'
RETURN 0
RETURN 0
fiName = "'USER1.SEQTEST'"
"ALLOC DATASET("fiName") FILE(OUTFILE)",
"RECFM(V) CATALOG NEW",
IF rc <> 0 THEN
SAY 'ALLOCATE ERROR CODE = 'rc
ELSE DO
'FREE FI(OUTFILE)'
"PIPE (END ;) LIT /data line/ | > "fiName" | CONS ONLY"
END
RETURN 0
EndMe: PROCEDURE
'UNIQUE'
RETURN 0
return
/* ----------- Obtain data for RESDYN display (option 12) ----------- */
/* Notice that the stem variable "out." is in our local variable */
/* dictionary. VIEW could always read these value; new for V5R1, */
/* we will have an opportunity to update them while VIEW is active. */
/* --------------------------------------------------------------- */
fillVars:
ARG xtraStg /* use extra first time only */
'PIPE (NAME RESDYN END %)',
'| NETVIEW RESOURCE',
'| SEPARATE DATA', /* No use for DSI386I title line */
'| STC: FANOUT', /* MAYBE need extra copies */
'| EDIT SKIPTO /=/ 2.* STRIPL 1 ',
'| COLOR WHITE',
'| $STEM OUT.',
xtraStg
TM = date() time()
$TM = 'CB HR'
return
178 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
Notice that this sample does not pre-populate the VIEW variables
with values as in resdyn (12) above. Instead, a LITERAL value in
the TimdResc command causes a message to be returned to us promptly.
The first instance of VIEW initializes, then returns control here
and we populate the values from the first "asynchronous" response.
return
/* ----------- Obtain data for pRESDYN display (option 13) ---------- */
/* Notice that the stem variable "out." is in our local variable */
/* dictionary. VIEW could always read these values; new for V5R1, */
/* we will have an opportunity to update them while VIEW is active. */
/* --------------------------------------------------------------- */
preFillVars:
'PIPE (NAME PRESDYN END %)',
'| SAFE *',
'| SEPARATE DATA', /* No use for DSI386I title line */
'| STC: FANOUT', /* MAYBE need extra copies */
'| EDIT SKIPTO /=/ 2.* STRIPL 1 ',
'| COLOR WHITE',
'| $STEM OUT.'
TM = date() time()
$TM = 'CB HR'
return
HALT:
IF symbol('step') = 'VAR' THEN
say 'CNMS1101 function' step 'ends.'
'pipe hole | keep resdyn' /* empty safe created by resdyn (12) */
EXIT -5
CNME1080
The following is an example of updating a common global variable re-entrantly.
/*-----------------------------------------------------------------------*/
/* FUNCTION : This CLIST sets updates a specified common global */
/* variable by a specified numeric amount upto a */
/* a specified maximum. */
/* */
/* NOTE : The CLIST may not be used directly by an operator. Call */
/* from automation, another CLIST, or directly from code. */
/* */
/* COMMAND INPUT PARMS: */
/* 1 - Name of the variable to be updated. */
/* 2 - "BY" */
/* 3 - Increment size */
/* 4 - "MAX" */
/* 5 - maximum value allowed for the global variable */
/* Note, if the increment size is negative, this */
/* is a minimum. */
/* */
/* Default for BY amount is 1; "BY" required if BY amount specified. */
/* Default for MAX is "no maximum"; "MAX" required when a value is */
/* specified */
/* */
/* FUNCTION/SUBROUTINE INPUT PARMS: */
/* This clist may also be called as a REXX function. When called as */
/* a function, the three inputs should be separated by commas and */
/* the result of the update is returned as the function result. */
/* As above, the Increment (second arg) and Max result (third arg) */
/* can be omitted. For example, */
/* */
/* x = updcglob(aComVar,2,500) /+ add 2, but stop at 500 +/ */
/* say 'Updated value of aComVar is' x */
/* */
/* */
/* OUTPUT : */
/* NORMAL: Named common global variable is updated. */
/* Common global variable <varname> has been updated to */
/* <newvalue>. */
/* rc = 0 */
/* Function return: new value. */
/* */
/* */
/* ERROR: Value would have exceeded specified maximum: */
/* "Common global variable '&1' was too big to update(val). */
/* It still has the value 'nnn'." */
/* rc = 4 */
/* */
/* Function return: previous value plus one increment */
/* */
/* DSI004, DSI069 */
/* RC = 16 */
/*-----------------------------------------------------------------------*/
ADDRESS NETVASIS
parse source RxH InvType fName CLD fm synPH inAddr h
IF InvType = 'COMMAND' THEN
do;
func = 0
arg varName byStr 'MAX' maxValue
IF varName = '?' THEN SIGNAL help
IF varName = '' THEN SIGNAL missing
parse var byStr . 'BY' addend
end;
ELSE
do;
func = 1
varName = arg(1)
addend = arg(2)
maxValue = arg(3)
180 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
end;
IF verify('|=;?',varName,'M') > 0 THEN SIGNAL missing
SELECT
WHEN maxValue = '' THEN NOP /* that's fine; no maximum */
WHEN datatype(maxValue,'N') THEN NOP /* that's the max, maximum */
OTHERWISE SIGNAL missing
END
SELECT
WHEN addend = '' THEN addend = 1 /* okay, use default increment */
WHEN datatype(addend,'N') THEN NOP /* swell, he gave us a number */
OTHERWISE SIGNAL missing
END
IF func THEN
rc = 0
ELSE
do;
CALL testSec
rc = result
end;
loadString = ';' || varName || '=oldValue;'
do WHILE (RC = 0)
'PIPE var (common)' varName '| VAR oldValue' /* Previous value */
IF rc = 0 THEN
do;
SELECT;
WHEN (oldValue = '') THEN
newValue = addend
WHEN (dataType(oldValue,'N')) THEN
newValue = oldValue + addend
WHEN (func) THEN
newValue = addend
OTHERWISE
SIGNAL badOldVal
END;
SELECT;
WHEN (maxValue = '') THEN NOP /* no max; no checking */
WHEN (addend >= 0 & newValue > maxValue) THEN
do;
IF func THEN return NewValue
SIGNAL exceedMax
end;
WHEN (addend < 0 & newValue < maxValue) THEN
do;
IF func THEN return NewValue
SIGNAL exceedMax
end;
OTHERWISE nop
END;
182 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
CNMSRVAR Example
The following is an example of updating a single Revision variable.
/*********************************************************************/
/* --->
This sample shows how to manipulate the "revision variable" table
that exists in the NetView SSI and is loaded or queried using the
SETRVAR command. This sample, invoked as a command, will accept a
value of one variable. If the variable currently has a value, the
new value will be substituted, without altering the other, existing
variables. If the variable is new, it will be added.
Remember that a null value (zero length) is the same (for revision
variables) as not defined. Therefore this sample can be used to
delete one variable.
/* --->
*/
We will feed the SETRVAR command the results of a SETRVAR QUERY. If
that message is not altered then it simply reloads the table with the
same values. (SETRVAR ignores label lines on input.) However, this
pipe will alter the message by deleting the line with our input
variable name and then inserting a new one with the new value.
When called for "current message," SETRVAR reads only the hex part
of each line and it expects that hex to begin in position 33, as it
does in the output of SETRVAR QUERY.
<--- */
/* The next bit is optional. Let operator know that it all worked. */
IF RC = 0 THEN /* pipe & commands work? */
'SETRVAR QUERY' /* reassure oper */
/*
Sample output from SETRVAR QUERY.
Deleting a data line and substituting another causes the revision
variable table to be loaded with one variable different.
SETRVAR sets new values from the hex portion of the line.
BNH332I For NETV there are 2 revision variables.
BNH325I Table loaded by TOM at 09/09/19 19:00:33
MYFIRST Lovely thing! D396A58593A840A3888995875A
SOLEMVAR keep Trucking? 9285859740E399A483928995876F
| |
1 33
*/
exit RC
CNMSRVMC Example
The following is an example of the Command Revision NETVONLY action.
/* ----------->
Sample NETVONLY action command. This command gets control as a result
of a Command Revision action: NETVONLY=CNMSRVMC
Use any REXX function here, but the message based functions that return
meaningful data are only sysconid() and sysid(). Use the recedata()
function to obtain information about the origin of the command.
<---------- */
ADDRESS NETVASIS
/* important! prevent abuse by checking for proper environment */
callerASID = RECEDATA() /* Obtain ASID of cmd issuer */
IF X2D(callerASID) = 0 THEN /* no RECE data? Then call must... */
SIGNAL BadEnvr /* not be from NETVONLY action. */
184 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
exit 0
/* Ask the operator to confirm. Wait for response to the WTOR.
Note: Waiting for the response here DOES NOT block other
NETVONLY actions from proceeding.
Note: if confirmed, this procedure issues the exact same command
that caused this NETVONLY action. This will not start a loop
and the reissued command will appear to have originated in the
same environment as the original command (username &
console).
---------- */
startTooBig:
WTO.TEXT = 'TLH916W Procedure' PARM1 'is intensive.',
'Answer "Y" to continue'
'WTOR'
IF WTO.REPLY = 'Y' THEN
'REISSUE MVS' fullCmd
ELSE
do;
WTO.TEXT = 'TLH917I start' PARM1 'canceled.'
'WTO'
'REISSUE SUPPRESS'
end;
RETURN /* from startTooBig */
getNVassoc:
username = RECEDATA('U')
SELECT
WHEN (username = '*BYPASS*') THEN
'WTO TLH006E Please logon to your system console'
WHEN (sysconid() = 'INSTREAM' | sysconid() = 'INTERNAL') THEN
'WTO TLH026E Console' sysconid() 'cannot associate with NetView.'
OTHERWISE
do
'AUTOTASK OPID=' || username || 'CONSOLE=' || sysconid()
IF rc = 0 THEN
'MSG' username 'association with NetView,' domain()', successful.'
ELSE
'WTO TLH662E Association with NetView failed:' RC
end
END
'REISSUE SUPPRESS'
RETURN /* from getNVassoc */
BadEnvr:
'MESSAGE DSI290 CNMSRVMC' opid()
exit 12
DSPRSTAT Example
The following is an example of a command list that uses the same type of function as “CHKRSTAT
Example” on page 172.
/**********************************************************************/
/* */
/* 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'
186 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
LISTVAR Example
/* Use NetView HELP for more information about this clist.
************************************************************************
* *
* NAME(LISTVAR) SAMPLE(CNME1006) RELATED-TO() *
* *
* CNME1006 Change Activity: *
* ID=Reference,Ver,Date,Developer: Description *
* ------------------------------------------------------ *
* *
***********************************************************************/
towerList = tower('*')
'PIPE var towerList | edit word 1.*|var TowerList'
CALL say353 'TOWERS' towerList
PRINT Example
The following 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 */
188 IBM Z NetView: Programming: REXX and the NetView Command List Language
REXX Command Lists
TYPE Example
The following 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
The following is an example of a command list that does essentially the same thing as the example in
“TYPE Example” on page 189, but closes the data set in case of error.
/**********************************************************************/
/* 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
rc = 0
parse arg datasetname '(' member ')' extra
if datasetname = '' | parmcnt() > 1 | member = '' | extra ¬= '' then
do
say 'Incorrect syntax used.'
say 'Correct syntax is : '
say ' TYPE dataset.name(member) '
rc = 24
end
else
do
'trap and suppress only messages CNM272I'
signal on halt
'allocate da('datasetname'('member')) shr'
'wait 5 seconds for messages'
'msgread'
if msgid() = 'CNM272I' then
do
ddname = msgvar(1)
if fndmbr(ddname,member) ¬= 0 then
do
say 'Member' member 'does not exist.'
rc = 4
end
else
do
address mvs 'execio * diskr' ddname '(finis'
do while queued() ¬= 0
pull record
say substr(record,1,68)
end
signal off halt
'free file('ddname')'
'trap no messages'
'message 309I ''TYPEIT'',''clist is now finished.'''
end
end
end
return rc
halt:
'free file('ddname')'
'trap no messages'
return -5
error: say 'Error occurred. Return code is' rc
return -1
190 IBM Z NetView: Programming: REXX and the NetView Command List Language
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries.
Consult your local IBM representative for information on the products and services currently available in
your area. Any reference to an IBM product, program, or service is not intended to state or imply that only
that IBM product, program, or service may be used. Any functionally equivalent product, program, or
service that does not infringe any IBM intellectual property right may be used instead. However, it is the
user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.
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:
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS"
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE.
Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore,
this statement might not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication.
IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
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.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
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
Such information may be available, subject to appropriate terms and conditions, including in some cases
payment of a fee.
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.
Information concerning non-IBM products was obtained from the suppliers of those products, their
published announcements or other publicly available sources. IBM has not tested those products and
cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of
those products.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs
in any form without payment to IBM, for the purposes of developing, using, marketing or distributing
application programs conforming to the application programming interface for the operating platform for
which the sample programs are written. These examples have not been thoroughly tested under all
conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these
programs. You may copy, modify, and distribute these sample programs in any form without payment to
IBM for the purposes of developing, using, marketing, or distributing application programs conforming to
IBM’s application programming interfaces.
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
This publication documents intended Programming Interfaces that allow the customer to write programs
to obtain the services of IBM Z NetView.
Trademarks
IBM, the IBM logo, and ibm.com® are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be
trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at
"Copyright and trademark information" at http://www.ibm.com/legal/copytrade.shtml .
Adobe is a trademark of Adobe Systems Incorporated in the United States, and/or other countries.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or
its affiliates.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or
both.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Other product and service names might be trademarks of IBM or other companies.
192 IBM Z NetView: Programming: REXX and the NetView Command List Language
Privacy policy considerations
IBM Software products, including software as a service solutions, (“Software Offerings”) may use cookies
or other technologies to collect product usage information, to help improve the end user experience, to
tailor interactions with the end user or for other purposes. In many cases no personally identifiable
information is collected by the Software Offerings. Some of our Software Offerings can help enable you to
collect personally identifiable information. If this Software Offering uses cookies to collect personally
identifiable information, specific information about this offering’s use of cookies is set forth below.
This Software Offering does not use cookies or other technologies to collect personally identifiable
information.
If the configurations deployed for this Software Offering provide you as customer the ability to collect
personally identifiable information from end users via cookies and other technologies, you should seek
your own legal advice about any laws applicable to such data collection, including any requirements for
notice and consent.
For more information about the use of various technologies, including cookies, for these purposes, See
IBM’s Privacy Policy at http://www.ibm.com/privacy and IBM’s Online Privacy Statement at http://
www.ibm.com/privacy/details the section entitled “Cookies, Web Beacons and Other Technologies” and
the “IBM Software Products and Software-as-a-Service Privacy Statement” at http://www.ibm.com/
software/info/product-privacy.
Notices 193
194 IBM Z NetView: Programming: REXX and the NetView Command List Language
Index
Index 195
&VTCOMPID control variable 90 AUTOTASK (continued)
&WAIT control statement 130 NetView command list language control variable 84
&WEEKDAYN control variable 90 OST restrictions 11
&WRITE control statement 112 REXX function 84
&WTOREPLY control variable 65 AUTOTBL command 95
%INCLUDE 14 AUTOTOKE
NetView command list language control variable 49
REXX function 49
A AUTOWRAP setting 10
accessibility xii
ACTAPPLS example B
REXX 169
ACTIONDL BEGWRITE control statement 113
NetView command list language control variable 49 blanks stripping 92
REXX function 49 books
ACTIONMG see publications ix
NetView command list language control variable 49 built-in function
REXX function 49 NetView command list language
activating command lists 2 assignment statement 110
ACTLU example built-in function, &HIER 119
REXX 170 built-in functions
ADDRESS instruction 23 NetView command list language
AFTER command, scheduling command lists 6 &BITAND 117
ALL, &CONTROL operand 111 &BITOR 117
ALLOCATE, Z NetView command 25 &BITXOR 118
allocating data sets, Z NetView 25 &CONCAT 118
APPLID &HIER 119
NetView command list language control variable 83 &LENGTH 120
REXX function 83 &MSUSEG 121
AREAID &NCCFID 46, 122
NetView command list language control variable 49 &NCCFSTAT 46, 123
REXX function 49 &SUBSTR 124
WTO command 49 definition 116
arithmetic operations, assignment statements 109 REXX 13
ASID
NetView command list language control variable 83
REXX function 83
C
Assembler command processors, nesting REXX command C command procedures, nesting REXX command lists 26
lists 26 CALL instruction, using 22
assignment calling another command list 6
clauses, REXX 13 CGI
statements, NetView command list language 109 REXX function 84
AT command, scheduling command lists 6 CGLOBAL
ATTENDED control statement 144
NetView command list language control variable 84 REXX function 48
REXX function 84 CHKOPNUM, example command list 171
ATTNID CHKRSTAT, example command list 172
NetView command list language control variable 49 CHRON command, scheduling command lists 6
REXX function 49 clauses, REXX 13
AUTBYPAS CLEAR command 113
REXX function 38 CLOSING
AUTCONID REXX function 84
NetView command list language control variable 84 CMD
REXX function 84 &CONTROL operand 111
AUTHCHK command 9
REXX function 39 CMDNAME
AUTHCHKX REXX function 43
REXX function 41 CMDSYN statement 2
AUTODROP command, REXX 4 CNME1080, example command list 180
Automation CNMS1101, example command list 173
looping 97 CNMSRVAR, example command list 183
automation task 11 CNMSRVMC, example command list 184
automation, message 95 code points, translating 34
AUTOTASK
196 IBM Z NetView: Programming: REXX and the NetView Command List Language
coding conventions commands (continued)
NetView command list language operator (continued)
continuation statements 100 running command lists 6
double-byte character text 101 OVERRIDE 5
suppression character conventions 101 RESET 135
syntax 99 RETURN 8
REXX session monitor, using command lists 8
coding non-REXX commands, REXX command list STACK 135
19 status monitor, using command lists 8
record size 19 system 9
suppressing display, non-REXX command 21 TRACE END (TE) 27
syntax 19 TRACE START (TS) 26
command UNSTACK 135
processing information VIEW 10
REXX functions 65 VTAM 8
command list information comments
NetView command list language control variables 38 NetView command list language 108
REXX functions 38 REXX 13
command list language, NetView 1 common global variables
command lists NetView command list language 144
activating 2 comparing NetView command list language, REXX 149
commands used in 164 CONCAT built-in function 118
compiling command lists 13 constants, assignment statements 109
creating 2 continuation statements 100
creating data sets, MVS 2 CONTINUE, &WAIT operand 138
definition 1 CONTROL control statement 111
display, controlling during processing 11 control statements, NetView command list language
loading, main storage 4 &BEGWRITE 113
long-running commands, using 9 &CGLOBAL 144
message driven 95 &CONTROL 111
naming 2 &EXIT 129
nested 6 &GOTO 129
network commands, using 8 &IF 127
overview 1 &PAUSE 114
restrictions under PPT 10 &TGLOBAL 144
routing messages 95 &WAIT 130
running 4 &WRITE 112
startup, examples 2 comparison, REXX instructions 149
system commands, using 9 definition 110
updating 2 control variables, NetView command list language
using 1 &1 – &31 136
Command Revision Table 65 &ACTIONDL 49
commands &ACTIONMG 49
AFTER 6 &APPLID 83
ALLOCATE 25 &AREAID 49
AT 6 &ASID 83
AUTODROP 4 &ATTENDED 84
AUTOTBL 95 &ATTNID 49
CHRON 6 &AUTCONID 84
CMD 9 &AUTOTASK 84
DEFAULTS 5 &AUTOTOKE 49
EVERY 6 &CURCONID 84
EXECIO 24 &CURSYS 85
FREE 25 &DATE 91
full-screen 10 &DESC 49
GO 135 &DISTAUTO 85
hardware monitor, using command lists 8 &DOMAIN 85
MSGROUTE 95 &HCOPY 91
network 8 &HDRMTYPE 50
operator &IFRAUGMT 50
AFTER 6 &IFRAUI3X 51
AT 6 &IFRAUIN3 51
CHRON 6 &IFRAUIND 51
EVERY 6 &IFRAUSB2 52
Index 197
control variables, NetView command list language (continued) control variables, NetView command list language (continued)
&IFRAUSC2 52 &SYSID 65
&IFRAUSDR 52 &SYSPLEX 87
&IFRAUSRB 52 &TASK 88
&IFRAUSRC 52 &TIME 91
&IFRAUTA1 53 &VTAM 89
&IFRAUWF1 54 &VTCOMPID 90
&JOBNAME 54 &WAIT, using 135
&JOBNUM 54 &WEEKDAYN 90
&KEY 54 &WTOREPLY 65
&LINETYPE 55 comparing REXX functions 150
&LU 91 definition 107
&MCSFLAG 55 JOBNAME 86
&MSGASID 56 MSGITEM(n) 61
&MSGAUTH 56 CONTWAIT, &WAIT operand 137
&MSGCATTR 56 conventions
&MSGCMISC 56 typeface xiii
&MSGCMLVL 57 creating command lists 2
&MSGCMSGT 57 CURCONID
&MSGCNT 57 NetView command list language control variable 84
&MSGCOJBN 57 REXX function 84
&MSGCPROD 58 CURSYS
&MSGCSPLX 58 NetView command list language control variable 85
&MSGCSYID 58 REXX function 85
&MSGDOMFL 58
&MSGGBGPA 59
&MSGGDATE 59
D
&MSGGFGPA 59 DATA (%DATA) directive 17
&MSGGMFLG 60 Data REXX
&MSGGMID 60 /*%DATA directive 17
&MSGGSEQ 60 /*%LOGIC directive 18
&MSGGSYID 60 host command environment 24
&MSGGTIME 60 processing 17
&MSGID 60 data set information functions 46
&MSGORIGIN 61 data set, information functions 46
&MSGSRCNM 62 data set, MVS 2
&MSGSTR 62 DATE control variable 91
&MSGTOKEN 62 DBCS 101
&MSGTSTMP 63 deallocating data sets, Z NetView 25
&MSGTYP 63 DEFAULTS command 5
&MVSLEVEL 86 DESC
&MVSRTAIN 63 NetView command list language control variable 49
&NCCFCNT 45 REXX function 49
&NETID 86 WTO, WTOR commands 49
&NETVIEW 86 directory names, notation xiii
&NVDELID 64 DISC
&OPID 82 REXX function 85
&OPSYSTEM 87 DISPLAY
&PARMCNT 44 &WAIT operand 137
&PARMSTR 44 display, controlling 11
&PARTID 87 displaying panels 10
&PRTY 64 DISTAUTO
&REPLYID 64 NetView command list language control variable 85
&RETCODE 45 REXX function 85
&RXDEFENV 90 DOMAIN
&RXDEFSTR 90 NetView command list language control variable 85, 86
&RXNUMENV 90 REXX function 85
&RXOVRENV 90 domain information, REXX functions 45
&RXOVRSTR 91 double-byte character set characters (DBCS)
&SESSID 64 &CONCAT, using 118
&SMSGID 65 &SUBSTR, using 125
&STCKGMT 87 coding conventions, NetView command list language
&SUPPCHAR 87 101
&SYSCONID 65 PPT, command list 11
198 IBM Z NetView: Programming: REXX and the NetView Command List Language
DOUBLESUPP character 102 full-screen commands, using 10
DROPCL 4 function packages, REXX, writing 23
DSPRSTAT, example command list 185 functions
built-in
NetView command list language 116
E REXX 13
ECVTPSEQ REXX
REXX function 85 ACTIONDL() 49
editing facilities, updating command lists 2 ACTIONMG() 49
ENDWAIT, &WAIT operand 134, 138 APPLID() 83
ENVDATA AREAID() 49
REXX function 86 ASID() 83
environment addressed by REXX, changing 23 ATTENDED() 84
environment variables, notation xiii ATTNID() 49
ERR, &CONTROL operand 111 AUTBYPAS 38
ERROR, &WAIT operand 134 AUTCONID() 84
errors, handling AUTHCHK() 39
NetView command list language 134 AUTHCHKX() 41
REXX 28 AUTOTASK() 84
EVENT AUTOTOKE() 49
REXX function 50 CGI() 84
event=-label pairs, &WAIT control statement 131, 134 CGLOBAL() 48
EVERY command, scheduling command lists 6 CLOSING() 84
examples CMDNAME() 43
ACTAPPLS CODE2TXT() 34
REXX 169 comparison, NetView command list language
ACTLU control variables 150
REXX 170 CURCONID() 84
command list using CURSYS() 85
&WAIT 140 DESC() 49
command lists DISC() 85
reference, define, update task global variables 145 DISTAUTO() 85
GETCG DOMAIN() 85
REXX 186 ECVTPSEQ() 85
GLOBVAR1 146 ENVDATA() 86
GREETING EVENT() 50
REXX 186 FNDMBR() 46
LISTVAR getpw() 82
REXX 187 HCOPY() 91
MSUSEG 81 HDRMTYPE() 50
NPDABA 82 HIER(n) 68
REXX command lists, NetView HMEPNAU 70
CHKOPNUM 171 HMEPNET 71
CHKRSTAT 172 HMEPNETV 71
CNME1080 180 HMFWDSNA 73
CNMS1101 173 IFRAUGMT() 50
CNMSRVAR 183 IFRAUI3X() 51
CNMSRVMC 184 IFRAUIN3() 51
DSPRSTAT 185 IFRAUIND() 51
PRINT 188 IFRAUSB2() 52
TYPE 189 IFRAUSC2() 52
TYPEIT 189 IFRAUSDR() 52
startup command lists 2 IFRAUSRB() 52
EXECIO command, REXX command list 24 IFRAUSRC() 52
EXIT control statement 129 IFRAUTA1() 53
expressions IFRAUWF1() 54
NetView command list language 109 IPV6ENV() 44
REXX 13 IPXLATE() 37
JOBNAME 86
JOBNAME() 54
F JOBNUM() 54
KEY() 54
FNDMBR, REXX function 46
LINESIZE() 23
FREE, Z NetView command 25
LINETYPE() 55
Index 199
functions (continued) functions (continued)
REXX (continued) REXX (continued)
LU() 91 SUBSYM() 36
MCSFLAG() 55 SUPPCHAR() 87
MSGASID() 56 SYSCONID() 65, 66
MSGAUTH() 56 SYSID() 65, 66
MSGCATTR() 56 SYSPLEX() 87
MSGCMISC() 56 TASK() 88
MSGCMLVL() 57 TGLOBAL() 48
MSGCMSGT() 57 TOWER() 89
MSGCNT() 57 TRAP 89
MSGCOJBN() 57 TYPE() 89
MSGCPROD() 58 VTAM() 89
MSGCSPLX() 58 VTCOMPID() 90
MSGCSYID() 58 WEEKDAYN() 90
MSGDOMFL() 58 WTOREPLY 65
MSGGBGPA() 59 functions, data set information 46
MSGGDATE() 59
MSGGFGPA() 59
MSGGMFLG() 60
G
MSGGMID() 60 GETCG example
MSGGSEQ() 60 REXX 186
MSGGSYID() 60 getpw
MSGGTIME() 60 REXX function 82
MSGID() 60 global variable information functions 48
MSGITEM(n) 61 global variables
MSGORIGN() 61 common
MSGREAD 30 NetView command list language 144
MSGSRCNM() 62 task
MSGSTR() 62 NetView command list language 144
MSGTOKEN() 62 GLOBALV
MSGTSTMP() 63 instruction
MSGTYP() 63 NetView command list language 148
MSGVAR(n) 63 GLOBVAR1 example 146
MSUSEG() 76 GO command 135
MVSLEVEL 86 GOTO control statement 129
MVSRTAIN() 63 GREETING example
NETID() 86 REXX 186
NETVIEW() 86
NPDABA() 76
NVCNT() 45 H
NVDELID() 64
hardware monitor commands, using 8
NVID(n) 46
HCOPY
NVMASTER() 46
NetView command list language control variable 91
NVSTAT() 46
REXX function 91
OPID() 82, 83
HDRMTYPE
OPSYSTEM() 87
NetView command list language control variable 50
PANEL() 87
REXX function 50
PARMCNT() 44
hexadecimal notation (NetView command list language) 108
PARTID() 87
HIER function
PRTY() 64
NetView command list language 119
recedata() 65
REXX 68
REPLYID() 64
HMEPNAU function 70
restrictions 23
HMEPNET function 71
ROUTCDE() 64
HMEPNETV function 71
RXDEFENV() 90
HMFWDSNA function 73
RXDEFSTR() 90
RXNUMENV() 90
RXOVRENV() 90 I
RXOVRSTR() 91
SESSID() 64 IF control statement 127
SMSGID() 65 IFRAUGMT
STCKGMT() 87 NetView command list language control variable 50
STORAGE() 23 REXX function 50
200 IBM Z NetView: Programming: REXX and the NetView Command List Language
IFRAUI3X L
NetView command list language control variable 51
REXX function 51 labels
IFRAUIN3 NetView command list language 102
NetView command list language control variable 51 REXX 13
REXX function 51 LENGTH built-in function 120
IFRAUIND LINESIZE function 23
NetView command list language control variable 51 LINETYPE
REXX function 51 NetView command list language control variable 55
IFRAUSB2 REXX function 55
NetView command list language control variable 52 LISTVAR example
REXX function 52 REXX 187
IFRAUSC2 LOADCL 4
NetView command list language control variable 52 loading command lists, storage 4
REXX function 52 LOGIC (%LOGIC) directive 18
IFRAUSDR logon, operator, automatically running command lists 5
NetView command list language control variable 52 long-running commands
REXX function 52 queuing 9
IFRAUSRB looping 97
NetView command list language control variable 52 LU
REXX function 52 NetView command list language control variable 91
IFRAUSRC REXX function 91
NetView command list language control variable 52
REXX function 52
IFRAUTA1
M
NetView command list language control variable 53 management services unit (MSU) functions
REXX function 53 &HIER 119
IFRAUWF1 &MSUSEG 121
NetView command list language control variable 54 HIER() 68
REXX function 54 MSUSEG() 76
information function, MSU 67 NetView command list language 116, 119, 121
initialization, running command lists 5 NPDABA() 76
instructions, REXX REXX 119, 121
ADDRESS 23 management services units information function 67
CALL 22 manuals
comparison, NetView command list language control see publications ix
statements 149 MAPCL 4
definition 13 MATCH 91
PARSE 21 MCSFLAG
restrictions 21 NetView command list language control variable 55
SAY 19, 22 REXX function 55
SIGNAL 28 MEMSTORE 4
TRACE END 26 MEMSTOUT 4
TRACE START 26 message
IP address processing 37 =-label pairs, coding 131, 134
IPV6ENV automating responses 95
REXX function 44 multiline, working 133
processing information
J REXX functions 48, 49
routing, command list 95
JOBNAME sending, operators 111
NetView command list language control variable 54 waiting, command lists
REXX function 54, 86 NetView command list language 138
JOBNAME control variable 86 message automation
JOBNUM command lists
NetView command list language control variable 54 defining 95
REXX function 54 running 5
testing 96
implementing 95
K midnight 91
KEY MSGASID
NetView command list language control variable 54 NetView command list language control variable 56
REXX function 54 REXX function 56
MSGAUTH
Index 201
MSGAUTH (continued) MSGORIGIN, NetView command list language control
NetView command list language control variable 56 variable 61
REXX function 56 MSGORIGN, REXX function 61
MSGCATTR MSGREAD
NetView command list language control variable 56 setting functions 30
REXX function 56 MSGROUTE command 95
MSGCMISC MSGSRCNM
NetView command list language control variable 56 NetView command list language control variable 62
REXX function 56 REXX function 62
MSGCMLVL MSGSTR
NetView command list language control variable 57 NetView command list language control variable 62
REXX function 57 REXX function 62
MSGCMSGT MSGTOKEN
NetView command list language control variable 57 NetView command list language control variable 62
REXX function 57 REXX function 62
MSGCNT MSGTSTMP
NetView command list language control statement 57, NetView command list language control variable 63
60 REXX function 63
REXX function 57 MSGTYP
MSGCOJBN NetView command list language control variable 63
NetView command list language control variable 57 REXX function 63
REXX function 57 MSGVAR, REXX function 63
MSGCPROD MSU (management services unit) functions
NetView command list language control variable 58 NetView command list language (built-in functions) 116
REXX function 58 REXX 119
MSGCSPLX MSU information function 67
NetView command list language control variable 58 MSUSEG function
REXX function 58 REXX usage examples 79
MSGCSYID multiline messages, using 133
NetView command list language control variable 58 MVS
REXX function 58 command 9
MSGDOMFL creating data sets 2
NetView command list language control variable 58 MVSLEVEL
REXX function 58 NetView command list language control variable 86
MSGGBGPA REXX function 86
NetView command list language control variable 59 MVSRTAIN
REXX function 59 NetView command list language control variable 63
MSGGDATE REXX function 63
NetView command list language control variable 59
REXX function 59
MSGGFGPA
N
NetView command list language control variable 59 NCCFCNT NetView command list language control variable
REXX function 59 45
MSGGMFLG NCCFID
NetView command list language control variable 60 built-in function 46, 122
REXX function 60 NCCFSTAT built-in function 46, 123
MSGGMID nested command lists
NetView command list language control variable 60 definition 6
REXX function 60 NetView command list language, using &WAIT 137
MSGGSEQ REXX
NetView command list language control variable 60 Assembler, C, PL/I command procedures 26
REXX function 60 using MSGREAD 30
MSGGSYID using TRAP 29
NetView command list language control variable 60 using WAIT 30
REXX function 60 testing 6
MSGGTIME NETID
NetView command list language control variable 60 REXX function 86
REXX function 60 NETVIEW
MSGID NetView command list language control variable 86
REXX function 60 REXX function 86
MSGITEM, NetView command list language control variable NetView command list language
61 coding conventions 99
MSGITEM, REXX function 61 comments 108
comparison, REXX 149
202 IBM Z NetView: Programming: REXX and the NetView Command List Language
NetView command list language (continued) OPSYSTEM (continued)
features 99 REXX function 87
functions, built-in 110 OST, autotask, restrictions 11
labels 102 OVERRIDE command 5
null statements 108
variables 102
NetView commands
P
using &PAUSE 115 PANEL
using &WAIT 135 REXX function 87
network commands, using 8 panels, displaying 10
NOINPUT, &PAUSE operand 115 parameter variables, NetView command list language
NOSUB, &BEGWRITE operand 113 &WAIT, using 135
notation characteristics 104
environment variables xiii nested command lists, using 105
path names xiii null 106
typeface xiii passing, command list 104
NPDABA function quoted strings, using 106
REXX usage examples 81 special characters, using 106
null statements 108 PARMCNT
nulls stripping 92 NetView command list language control variable 44
NVCNT function 45 REXX function 44
NVDELID PARMSTR control variable 44
NetView command list language control variable 64 PARSE instruction 21
REXX function 64 parsing
NVID function 46 REXX command lists 26
NVMASTER function 46 PARTID
NVSTAT function 46 NetView command list language control variable 87
REXX function 87
O path names, notation xiii
PAUSE control statement, using NetView commands 114,
online publications 115
accessing xii pausing, REXX command list 21
operands PL/I command procedures, nesting REXX commands 26
ALL, &CONTROL control statement 111 PPT restrictions 10
CMD, &CONTROL control statement 111 PRINT, example command list 188
CONTINUE, &WAIT control statement 138 PROFILE statement 5
CONTWAIT, &WAIT control statement 137 PRTY
DISPLAY NetView command list language control variable 64
&WAIT control statement 137 REXX function 64
ENDWAIT, &WAIT control statement 134, 138 publications
ERR, &CONTROL control statement 111 accessing online xii
ERROR, &WAIT control statement 134 IBM Z NetView ix
NOINPUT, &PAUSE control statement 115 ordering xii
NOSUB, &BEGWRITE control statement 113
STRING, &PAUSE control statement 115
SUB, &BEGWRITE control statement 113
Q
SUPPCHAR 87 queuing long-running commands 9
SUPPRESS quotation marks, REXX command lists or Data REXX files 19
&WAIT control statement 137
VARS, &PAUSE control statement 115
operator R
command, running command lists 6
RECEDATA()
information
REXX function 65
NetView command list language control variables
record size
82
NetView command list language 100
REXX functions 82
REXX 19
input, REXX command list 21
REPLYID
logon, command list 5
NetView command list language control variable 64
sending messages 111
REXX function 64
OPID
RESET command 135
NetView command list language control variable 82
Restructured Extended Executor (REXX) language
REXX function 82, 83
command lists
OPSYSTEM
coding non-REXX commands 21
NetView command list language control variable 87
Index 203
Restructured Extended Executor (REXX) language (continued) S
command lists (continued)
compiling 13 SAY instruction, using 19, 22
environment functions 90 scope checking
environment, changing 23 variables, NetView command list language 146
errors, recovering 28 SECURITY
examples 169 controlling access, command lists 3
EXECIO command, using 24 running command lists when NetView is started 5
nesting assembler, C, PL/I command procedures 26 using network commands in command lists 8
operator input, pausing 21 SESSID
parsing 26 NetView command list language control variable 64
restrictions 21 REXX function 64
SAY instruction, using 19 session
suppressing non-REXX commands 21 information
tracing 26 NetView command list language control variables
TSO/E environments 25 83
command lists and data REXX files REXX functions 83
SAY instruction, using 22 monitor commands, command list 8
command lists and Data REXX files TAF example 2
coding conventions 19 SIGNAL instruction 28
return codes 27 SMSGID
command lists or Data REXX files NetView command list language control variable 65
CALL instruction, using 22 REXX function 65
LINESIZE function, using 23 STACK command 135
record size 19 status monitor commands, command list 8
restrictions 23 STCKGMT
STORAGE function, using 23 NetView command list language control variable 87
trailing blanks 19 REXX function 87
comparison, NetView command list language 149 STORAGE function 23
function packages, writing 23 STRING, &PAUSE operand 115
introduction 13 stripping, nulls and blanks 92
RETCODE control variable 45 SUB, &BEGWRITE operand 113
return codes SUBSTR built-in function 124
NetView command list language 45 SUBSYM, REXX function 36
REXX 27 SUPPCHAR 87, 101
RETURN command, REXX restrictions 8 SUPPCHAR control variable 87
ROUTCDE SUPPRESS
NetView command list language control variable 64 &WAIT operand 137
REXX function 64 suppressing
running command lists messages 95
another command list 6 non-REXX commands, REXX command lists 21
NetView is started 5 suppression characters 101
NetView receives messages 5 SYSCONID
operator command 6 NetView command list language control variable 65
operator logon 5 REXX function 65, 66
specified time 6 SYSID
user-written command procedure 8 NetView command list language control variable 65
RXDEFENV REXX function 65, 66
NetView command list language control variable 90 SYSPLEX
REXX function 90 NetView command list language control variable 87
RXDEFSTR REXX function 87
NetView command list language control variable 90 system commands, using 9
REXX function 90
RXNUMENV
NetView command list language control variable 90
T
REXX function 90 TAF
RXOVRENV session example 2
NetView command list language control variable 90 TASK
REXX function 90 NetView command list language control variable 88
RXOVRSTR REXX function 88
NetView command list language control variable 91 task global variables
REXX function 91 command list examples, reference, define, update 145
NetView command list language 144
TE command 27
204 IBM Z NetView: Programming: REXX and the NetView Command List Language
terminal information VARS, &PAUSE operand 115
NetView command list language control variables 91 VIEW command 10
REXX functions 91 VTAM
TGLOBAL commands 8
control statement 144 NetView command list language control variable 89
REXX function 48 REXX function 89
THEN clause, &IF control statement 128 VTCOMPID
TIME control variable 91 NetView command list language control variable 90
time intervals, running command lists 6 REXX function 90
Tivoli
user groups xii
Tivoli Software Information Center xii
W
tokens, message WAIT
NetView command list language 132 NetView command list language control statement
TOWER coding suggestions 140
REXX function 89 control and parameter variables 135
TRACE END command 27 customizing 137
TRACE START command 26 ending 135, 139
tracing, REXX command lists 26 general 130
translating code points 34 nested command lists, using 137
translation functions NetView commands, using 135
code-to-text function (CODE2TXT) 34 sample using 140
translation tables, code-to-text 34 REXX instruction
TRAP nested REXX command lists, using 30
REXX command list 29 WEEKDAYN
REXX function 89 NetView command list language control variable 90
TS command 26 REXX function 90
TSO/E environment 25 WRITE control statement 112
TSO/E EXECIO command 24 WTOREPLY 65
TYPE
REXX function 89
TYPE, command list example 189
typeface conventions xiii
TYPEIT, command list example 189
U
UNSTACK command 135
user group, NetView xiii
user groups
NetView xiii
Tivoli xii
user variables 107
user-written command procedure, activating command lists
8
V
variables
command list information
NetView command list language 38
REXX 38
operator information
NetView command list language 82
REXX 82
session information
NetView command list language 83
REXX 83
substitution order 103
terminal information
REXX 91
user 107
variables, notation for xiii
Index 205
206 IBM Z NetView: Programming: REXX and the NetView Command List Language
IBM®
SC27-2861-05