Performing File I/O; Syntax - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

Passing Information
CLIST
SYSCALL statement
SYSCALL SOMESUB &VAR
Sending information from a subprocedure
RETURN statement
. .
.
SYSCALL SOMESUB &VAR
SET ANSWER = &LASTCC
. .
.
END
SOMESUB: PROC 1 V1
. .
.
RETURN CODE(33) /* code goes to &LASTCC

Performing File I/O

CLIST
Reading from a file
OPENFILE, GETFILE, CLOSFILE statements
OPENFILE PAYCHEKS
SET COUNTER=1
DO WHILE &COUNTER \> 3
GETFILE PAYCHEKS
SET EMPLOYEE&COUNTER=&PAYCHEKS
SET COUNTER=&COUNTER+1;
END
CLOSFILE PAYCHEKS
Writing to a file
OPENFILE, PUTFILE, CLOSFILE statements
OPENFILE PRICES OUTPUT
SET PRICES = $2590.00
PUTFILE PRICES
CLOSFILE PRICES

Syntax

CLIST
Continuing a statement over more than one line
Use - or +
IF &STR(SYSDATE)=&STR(10/13/87) THEN +
WRITE On &SYSDATE the system was down.
202
z/OS V1R1.0 TSO/E REXX User's Guide
REXX
CALL instruction
call somsub var
Sending information from a subroutine
RETURN instruction
. .
.
call somesub var
answer = RESULT
exit
somesub:
arg v1
. .
.
value = 4 * v1 / 3
*/
return value
/* value goes to RESULT
REXX
Reading from a file
EXECIO DISKR, EXECIO DISKRU commands
'EXECIO 3 DISKR indd (stem employee. FINIS'
/* Read 3 records from the data set in indd. */
/* The 3 records go to a list of compound
/* variables with the stem of employee. They */
/* are employee.1, employee.2 and employee.3 */
Writing to a file
EXECIO DISKW
push '$2590.00' /* put amount on data stack */
'EXECIO 1 DISKW outdd (finis'
/*Write from data stack to data set in outdd */
REXX
Continuing an instruction over more
than one line
Use ,
say 'This instruction',
*/
'covers two lines.'
*/

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents