You are on page 1of 4

MVS REXX

Course No. Description


2245

This seminar is designed for users intending to learn REXX in the MVS environment. Students will study the REXX interpreter as a basis for understanding techniques for writing efficient and readable REXX code. Templates, tracing, and interpreting will be reviewed as well as Generic built-in functions will be reviewed. During laboratory exercises users will test REXX in a variety of commonplace application scenarios. Students will learn how to create their own subroutines and functions. Terminal output will be trapped from MVS and TSO/E. Techniques will be presented to manage the program stack. MVS file I/O programs written in REXX will be scrutinized and tested in laboratory exercises. During the seminar students will also gain an increased awareness of the MVS environment, and will have opportunities to submit MVS REXX execs to the batch processor for background execution.

Audience Prerequisites

This course is intended for all programmers intending to start mastering the REXX language on the MVS platform.

Familiarity with TSO/E, ISPF, and ISPF Editor is required. Experience with JCL would be beneficial but is not required.

Objectives

Write efficient, readable REXX code Choose between various REXX templates for parsing Exploit INTERPRET and interactive debug TRACE Create their own built in REXX functions Trap console output from MVS and TSO/E Effectively manage the program stack Read, write, and update MVS files Submit MVS REXX execs to MVS batch processor

Major Topics

Introduction Environmental Commands Tracing REXX Instructions Error Trapping

Built-in Function Sub procedures The Program Stacks Specific MVS REXX Functions Output Traps

File I/O Running MVS REXX in Batch The SAA REXX/370 Compiler

Duration
2007-08 | Keane, Inc.

3 days

Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA info@keane.com

www.keane.com/education/

Course Contents
1. Why REXX?
Objectives Why REXX? What is REXX like? What Can REXX do? REXX on TSO Comparison with CLISTs Execution Differences: CLIST and REXX REXX Syntax Setting up to Execute Parse Version The Template With Just Variables A Literal in a Template Exercises A Variable Instead of a Literal Column Delimiting with Single Numbers Column Delimiting with Two Numbers

5. Debugging
Objectives What You Can Do During Interactive Debug Interactive Debug Codes Debugging Tracing Instructions Trapping Errors The Trap That Terminates The Trap That Continues Trap Continues with Chosen Name Condition Trapping TSO/ISPF Command Trapping Failure Failure Trap That Continues Trapping Novalue Trapping PA1 or ATTN Trapping With A Choice Trap Ingredients The Infamous GO TO GO TO Exercise 28

2. REXX Components
Objectives REXX Verbs and Keywords Assignment Command Label Function The Literal Hexadecimal String REXX Variables The Basic Subset

3. Concatenation and Logic


ObjectivesConcatenating Data IF The Conditional Comparison Operators The DO END Construction Fuzzing: Not Quite EqualBoolean Operators

4. String Manipulation With Parse


Objectives Parse Function of Parsing Parse Origin Parsing in a Main Program ARG and DATASET Names Converting CLIST PROC to REXX ARG Parsing Arguments in a Function Subroutine Parsing From The Stack and Terminal Parsing From Terminal Only Parsing a Variable Parsing a Literal Value Parse Source

6. Math
Objectives Math Precision Rounding

7. Select CASE Structure


Objectives Select: CASE Structure Select Example Select and NOP Select and OTHERWISE

Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA info@keane.com

www.keane.com/education/

8. Passing Commands to the Environment


Objectives General When REXX Will Pass Command to the Environment How REXX Decides What Environments Can REXX Talk To? When Can REXX Work with TSO, ISPF, ISPF Editor? What is the Normal Default Environment? Passing One Command to an Environment Is an Environment Available? Talking to ISPF Using Variable Services File Tailoring Services File Tailoring Example File Tailoring Panel File Tailoring Edit Macro Edit Macro Environment and Parms Edit Macro with Multiple Parms Edit Macros with Variables

General Format of Internal Function/Subroutine External Functions/Subroutines Subroutine Exercise Function Exercise User Written Functions Internal Exercise External Exercise

10. Looping
Objectives Looping DO WHILE DO UNTIL DO UNTIL Exercise Stepping with DO DO FOREVER Looping N Times DO n TIMES ITERATE Looping Exercise LEAVE

9. Built-In FUNCTIONS
Objectives Built-in FUNCTIONS REXX Provides Result of Functions Using RESULT Using Null with Functions DATATYPE Function LENGTH Function POS Function QUEUED Function SUBSTR Function X2D and D2X Functions Functions Found Only on TSO LISTDSI Function LISTDSI Example MSG Function OUTTRAP Function OUTTRAP Example SYSDSN Function User Written Functions/Subroutines

11. REXX The Stack


Objectives What is the Stack? How Do You Put Thing Into the Stack? How Do You Take Things From the Stack? Description of the Stack Data in the Stack Terminal Input QUEUE and EXECIO PUSH and the Stack Removing Data from the Stack Counting Lines in the Stack Bypassing the StackBottom of the Stack Sending the Stack to TSO Isolating the Stack NEWSTACK Functions Used with the Stack Clearing the Stack Passing Information to Another Program

Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA info@keane.com

www.keane.com/education/

12. Compound Variables


Objectives What is a Compound Variable? Compound Variable Example Compound Variables and Subscripts Exercise What are Compound Variables Used For? Stepping Through the ExtensionsLoading and Unloading an ArrayChanging the Stem Using Two or More Extensions

13. EXECIO
Objectives EXECIO EXECIO Format What Do You Read Into? Where Do You Write From? EXECIO Syntax Reading a Whole File into the Stack Reading a Whole File into the Stack Exercise Reading One Record at a Time Reading One Record ExerciseReading a Whole File into an Array Reading a Whole File into an Array Exercise Additional Option for Reading EXECIO Writing Writing from the Stack Example Writing from the Stack Explanation Writing One Line at a Time from Stack Exercise Copy a File Using the Stack Writing from an Array The INTERPRET Instruction INTERPRET Exercise

Appendix A
Converting from CLISTS Codes Displayed During Interactive Debug Tracing Instruction You Can Put in Your Programs

Australia | Canada | China | France | India | New Zealand | Singapore | Switzerland | UAE | UK | USA info@keane.com

www.keane.com/education/