EasyManua.ls Logo

IBM TSO/E REXX User Manual

IBM TSO/E REXX
242 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #97 background imageLoading...
Page #97 background image
To determine whether to make a function internal or external, you might consider
factors, such as:
v Size of the function. Very large functions often are external, whereas small
functions fit easily within the calling exec.
v How you want to pass information. It is quicker to pass information through
variables in an internal function. This method is described in the next topic under
Passing Information by Using Variables.
v Whether the function might be of value to more than one exec or user. If so, an
external function is preferable.
v Performance. The language processor searches for an internal function before it
searches for an external function. For the complete search order of functions,
see Search Order for Functions on page 134.
Passing Information to a Function
When an exec and its internal function share the same variables, you can use
commonly shared variables to pass information between caller and internal function.
The function does not need to pass arguments within the parentheses that follow
the function call. However, all functions, both internal and external, must return a
value.
Passing Information by Using Variables
When an exec and its internal function share the same variables, the value of a
variable is what was last assigned, regardless of whether the assignment was in the
main part of the exec or in the function. In the following example, the value of
answer is assigned in the function and displayed in the main part of the exec. The
variables number1, number2, and answer are shared. In addition, the value of answer
replaces the function call because answer follows the RETURN instruction.
REXX.EXEC(MAIN)
instruction(s)
x=func2(arg1)
instruction(s)
.
.
.
exit
REXX.EXEC(FUNC2)
ARG var1
instruction(s)
RETURN value
Writing a Function
Chapter 6. Writing Subroutines and Functions 79

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the IBM TSO/E REXX and is the answer not in the manual?

IBM TSO/E REXX Specifications

General IconGeneral
BrandIBM
ModelTSO/E REXX
CategoryComputer Hardware
LanguageEnglish

Summary

Part 1. Learning the REXX Language

Chapter 1. Introduction

Explains the REXX programming language, its features, and suitability for various users.

Chapter 2. Writing and Running a REXX Exec

Details the process of writing, running, and understanding REXX execs, including syntax rules and common issues.

Chapter 3. Using Variables and Expressions

Covers REXX variables, expressions, operators, and tracing techniques for data manipulation and calculations.

Chapter 4. Controlling the Flow Within an Exec

Explains how to alter REXX exec execution using conditional, looping, and interrupt instructions.

Chapter 5. Using Functions

Describes REXX functions, including built-in, user-written, and packages, and how to use them.

Chapter 6. Writing Subroutines and Functions

Guides on writing, calling, and passing information to REXX subroutines and functions.

Chapter 7. Manipulating Data

Covers REXX data manipulation using compound variables, stems, and various parsing techniques.

Part 2. Using REXX

Chapter 8. Entering Commands from an Exec

Explains how REXX execs can interact with the operating system by issuing TSO/E and host commands.

Chapter 9. Diagnosing Problems Within an Exec

Details techniques for diagnosing and debugging REXX execs using tracing and special variables.

Chapter 10. Using TSO/E External Functions

Describes TSO/E external functions available for interacting with the system and performing specific tasks.

Chapter 11. Storing Information in the Data Stack

Explains how to use the REXX data stack for temporary storage, passing information, and managing buffers.

Chapter 12. Processing Data and Input/Output Processing

Covers dynamic REXX expression modification and processing data to/from data sets using EXECIO.

Chapter 13. Using REXX in TSO/E and Other MVS Address Spaces

Explains how to run REXX execs in TSO/E and non-TSO/E MVS address spaces and available services.

Part 3. Appendixes

Appendix A. Allocating Data Sets

Guides on creating and allocating data sets, including checklists for ISPF/PDF and ALLOCATE commands.

Appendix B. Specifying Alternate Libraries with the ALTLIB Command

Details using the ALTLIB command to specify and manage alternative libraries for implicit execution.

Appendix C. Comparisons Between CLIST and REXX

Compares REXX and CLIST languages, highlighting similarities and differences in features and capabilities.

Appendix D. Notices

Provides legal notices, warranty disclaimers, copyright, and trademark information.

Bibliography

TSO/E Publications

Lists IBM publications related to TSO/E, including administration, CLISTs, and general information.

Related Publications

Lists IBM publications related to z/OS MVS and ISPF, covering system programming and administration.

Index

Related product manuals