Example of Using the Data Stack to Pass Information
/***************************** REXX ********************************/
/* This exec helps an inexperienced user allocate a new PDS. It
*/
/* prompts the user for the data set name and approximate size,
*/
/* and queues that information on the data stack. Then it calls
*/
/* an external subroutine called newdata.
*/
/*******************************************************************/
message = 'A data set name for a partitioned data set has three',
'qualifiers separated by periods. The first qualifier is usually',
'a user ID. The second qualifier is any name. The third qualifier',
'is the type of data set, such as "exec". Generally the user ID',
'is assumed, so you might specify a data set name as MYREXX.EXEC.',
'A new data set name cannot be the same as an existing data set',
'name. Please type a name for the new data set or type QUIT to end.'
SAY 'What is the new data set name? If you are unsure about'
SAY 'naming data sets, type ?. To end, type QUIT.'
PULL name
DO WHILE (name = '?') | (name = 'QUIT')
IFname = '?' THEN
DO
SAY message
PULL name
END
ELSE
EXIT
END
SAY 'Approximately how many members will the data set have:'
SAY '6 12 18 24 30 36 42 48 54 60?'
PULL number
QUEUE name
QUEUE number
CALL newdata
IFRESULT > 0 THEN
SAY 'An error prevented' name 'from being allocated.'
ELSE
SAY 'Your data set' name 'has been allocated.'
Example of the External Subroutine NEWDATA
/***************************** REXX ********************************/
/* This external subroutine removes the data set name and the
*/
/* number of members from the stack and then issues the ALLOCATE
*/
/* command.
*/
/*******************************************************************/
PULL name
PULL number
"ALLOCATE DATASET("name") NEW SPACE(50,20) DIR("number%6") DSORG(PO)",
"RECFM(V,B) LRECL(255) BLKSIZE(5100)"
RETURN RC
/* The return code from the TSO/E command sets the
*/
/* REXX special variable, RC, and is returned to the */
/* calling exec. A 0 return code means no errors.
*/
Using the Data Stack
Chapter 11. Storing Information in the Data Stack
141
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......