Programming: REXX and the Netview Command List Language
Total Page:16
File Type:pdf, Size:1020Kb
IBM Tivoli NetView for z/OS Version 6 Release 2 Programming: REXX and the NetView Command List Language IBM SC27-2861-02 IBM Tivoli NetView for z/OS Version 6 Release 2 Programming: REXX and the NetView Command List Language IBM SC27-2861-02 Note Before using this information and the product it supports, read the information in “Notices” on page 203. This edition applies to version 6, release 2 of IBM Tivoli NetView for z/OS (product number 5697-NV6) and to all subsequent versions, releases, and modifications until otherwise indicated in new editions. This edition replaces SC27-2861-01. © Copyright IBM Corporation 1997, 2013. 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 Tivoli NetView for z/OS library .......................... ix Related publications ............................... xi Accessing terminology online ............................ xi Using NetView for z/OS online help .......................... xii Accessing publications online ............................ xii Ordering publications ............................... xii Accessibility ................................... xiii Service Management Connect ............................. xiii Tivoli technical training ............................... xiii Tivoli user groups ................................. xiii Downloads ................................... xiii Support information ................................ xiv Conventions used in this publication .......................... xiv Typeface conventions ............................... xv Operating system-dependent variables and paths...................... xv Syntax diagrams................................. xv Chapter 1. Getting Started ............................ 1 The Benefits of Using Command Lists ........................... 1 Examples of Common Startup Command Lists ....................... 2 Examples of Activating a Network Control Program ..................... 2 Creating Command Lists ............................... 2 Controlling Access to Command Lists ........................... 4 Loading Command Lists into Storage ........................... 4 Running Command Lists ............................... 6 Running Command Lists When NetView Is Started ..................... 6 Running Command Lists When Logging On........................ 6 Running Command Lists after Receiving a Message or MSU .................. 7 Running Command Lists from a Terminal ........................ 7 Running Command Lists at a Specified Time or Time Interval .................. 7 Running Command Lists from Another Command List .................... 8 Running Command Lists from a User-Written Command Processor ............... 10 Using Network Commands in Command Lists ....................... 10 Using System Commands in Command Lists ....................... 10 Using Long-Running Commands in Command Lists..................... 10 Using Tivoli NetView for z/OS Pipelines ........................ 11 Using the VIEW Command ............................. 12 Using Full-Screen Commands ............................ 12 Primary POI Task Restrictions ............................ 12 AUTOTASK OST Restrictions ............................ 13 Controlling Command List Output ........................... 13 Working with Messages ............................... 14 Chapter 2. REXX Language Overview ...................... 17 Introduction to the REXX Language ........................... 17 Compiling and Running REXX Command Lists ....................... 17 Using %INCLUDE with Interpreted REXX ......................... 18 Using Data REXX ................................. 18 Processing Data REXX Files ............................. 20 Additional Information .............................. 21 © Copyright IBM Corp. 1997, 2013 iii Data REXX Directives ............................... 22 /*%DATA ................................... 22 /*%LOGIC .................................. 23 Coding Conventions for REXX Command Lists and Data REXX Files ................ 23 Record Size .................................. 24 Using Quotation Marks .............................. 24 Suppressing Display of Non-REXX Commands ...................... 26 Tivoli NetView for z/OS Restrictions on REXX Instructions ................... 26 Pausing for Operator Input ............................. 26 Using the SAY Instruction ............................. 27 Using the CALL Instruction ............................. 27 NetView Restrictions on REXX Functions ......................... 28 Writing REXX Function Packages ............................ 28 Changing the Environment Addressed by REXX Command Lists ................. 29 Data REXX Host Command Environment ......................... 29 Using the EXECIO Command ............................. 30 Using MVS and VTAM Commands ........................... 30 Using the NetView ALLOCATE and FREE Commands ..................... 30 Using REXX Command Lists ............................. 31 Nesting REXX Command Lists from Assembler, C, or PL/I ................... 32 Parsing in REXX Command Lists ............................ 32 Tracing REXX Command Lists ............................. 33 Return Codes in REXX Command Lists .......................... 33 Recovering from Errors in REXX Command Lists....................... 34 Chapter 3. REXX Instructions for Command Lists Run in a NetView Environment ... 37 Using TRAP in Nested REXX Command Lists ........................ 38 Using WAIT in Nested Command Lists .......................... 38 Using MSGREAD in Nested Command Lists ........................ 39 Functions Set by MSGREAD.............................. 39 Chapter 4. REXX Instructions for NetView REXX Command Lists and Data REXX Files 41 Translation Functions ................................ 42 IP Address Processing ................................ 45 Command List Information .............................. 46 Cross-Domain Information Functions ........................... 51 Data Set Information Functions ............................. 52 Global Variable Information Functions .......................... 54 Message Processing Information Functions ......................... 54 Message Processing Information ........................... 55 ROUTCDE Examples ............................... 66 Command Processing Information Functions ........................ 67 REXX Management Services Unit Information Functions .................... 69 Hardware Monitor (HMxxxxxx) Examples ........................ 78 MSUSEG Syntax and Examples............................ 81 Probable Cause Syntax and Examples ......................... 83 Operator Information Functions ............................ 84 Session Information Functions ............................. 85 REXX Environment Information Functions ......................... 90 Terminal Information Functions ............................ 91 Time and Date Variables ............................... 91 Nulls and Blanks Stripping .............................. 91 Chapter 5. Automation Resource Management .................. 93 Defining NetView Automation Table Command Lists ..................... 93 Routing Messages from Automation-Table-Driven Command Lists ................. 93 Implementing NetView Automation ........................... 93 Suppressing Messages ............................... 94 Determining the Environment for a Command List ..................... 94 Testing Automation Command Lists .......................... 94 iv Programming: REXX and the NetView Command List Language Looping and Automation .............................. 95 Considering Operator Interaction ........................... 96 Common Automation Problems ........................... 96 Appendix A. Writing Simple Command Lists in the NetView Command List Language 99 What the NetView Command List Language Includes ..................... 99 Coding Conventions for NetView Command List Language Statements ............... 100 Conventions for General Coding ........................... 100 Conventions for Continuing a Statement ........................ 100 Conventions for Double-Byte Character Set Text ...................... 101 Conventions for Suppression Characters ........................ 102 Labels ..................................... 102 Variables .................................... 103 Variable Substitution Order............................. 103 Parameter Variables ............................... 104 Passing Parameter Variable Information to a Command List.................. 105 Using Parameter Variables in a Command List ...................... 106 Passing Parameter Variables to a Nested Command List ................... 106 Using Quoted Strings or Special Characters in Parameter Variables ............... 107 Null Parameter Values .............................. 107 Control Variables ................................ 108 User Variables ................................. 108 Hexadecimal Notation ............................... 109 Comments ................................... 109 Null Statements ................................. 110 Assignment Statements ............................... 110 Control Statements ................................ 112 &CONTROL Statement .............................. 112 Writing to the Operator .............................. 113 Using NetView Commands with &PAUSE.......................