EasyManuals 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 #69 background imageLoading...
Page #69 background image
ITERATE
ELSE
SAY 'Number' count
END
This example results in a list of numbers from 1 to 10 with the exception of number
8.
Number 1
Number 2
Number 3
Number 4
Number 5
Number 6
Number 7
Number 9
Number 10
Exercises - Using Loops
1. What are the results of the following loops?
a.
DO digit=1TO3
SAY digit
END
SAY 'Digit is now' digit
b. DO count = 10 BY -2 TO 6
SAY count
END
SAY 'Count is now' count
c. DO index = 10 TO 8
SAY 'Hup! Hup! Hup!'
END
SAY 'Index is now' index
2. Sometimes an infinite loop can occur when input to end the loop doesnt match
what is expected. For instance, in the previous example using the LEAVE
Instruction on page 50, what happens when the user enters Quit and the PULL
instruction is changed to a PARSE PULL instruction?
PARSE PULL dataset_name
ANSWERS
1. The results of the repetitive loops are as follows:
a.
1
2
3
Digit is now 4
b.
10
8
6
Count is now 4
c.
(blank)
Index is now 10
2. The user would be unable to leave the loop because "Quit" is not equal to
"QUIT". In this case, omitting the PARSE keyword is preferred because
Using Looping Instructions
Chapter 4. Controlling the Flow Within an Exec 51

Table of Contents

Questions and Answers:

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

Related product manuals