EasyManuals Logo
Home>IBM>Computer Hardware>TSO/E REXX

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 #149 background imageLoading...
Page #149 background image
Example 2 Part 1 - Using the OUTTRAP Function
/**************************** REXX *********************************/
/* This exec adds a data set to the front of the data sets in the */
/* SYSPROC concatenation. It first asks for the name of the data */
/* set to add, then it finds all data sets currently allocated to */
/* SYSPROC, adds the new data set to the beginning and re-allocates*/
/* the concatenation to SYSPROC. */
/*******************************************************************/
SAY 'Enter the fully-qualified data set name you want added'
SAY 'to the beginning of the SYSPROC concatenation. Do NOT'
SAY 'place quotation marks around the data set name.'
PULL addname .
x = OUTTRAP('name.')/*Begin trapping lines of output from commands*/
/* Output goes to variables beginning with 'name.'*/
"LISTA ST" /* List the status of your currently allocations */
found = 'NO' /* Set the found flag to no */
i = 1 /* Set the index variable to 1 */
/*******************************************************************/
/* Loop through the lines of trapped command output to find lines */
/* 9 characters long or longer. Check those lines for the word */
/* SYSPROC until it is found or until all lines have been checked. */
/* If SYSPROC is found, the index is decreased one and the name of */
/* the first data set concatenated to SYSPROC is stored in variable*/
/* "concat". */
/*******************************************************************/
DO WHILE (found = 'NO') & (i <= name.0)
IF LENGTH(name.i) >= 9 THEN
IF SUBSTR(name.i,3,7) = 'SYSPROC' THEN
DO
found = 'YES'
i=i-1
concat = "'"name.i"'"
END
ELSE
i=i+1
ELSE
i=i+1
END
Additional Examples
Chapter 10. Using TSO/E External Functions 131

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