Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rexx tool waits for user input

Status
Not open for further replies.

gopikrishna

Programmer
Sep 8, 2003
6
IN
Hi,
I am writing a small rexx tool to read from 2 members and write into third. But when I execute it waits for my input. Instruction say 'wait' in the code below will execute only after I press enter. Can some body tell me why so?
/******REXX***********************/
"ALLOC DA('TSXAB1C.PROD.PGM(VP100B0P)') FI(PRODD) SHR REUSE"
"ALLOC DA(NEWPROD.PGM(VP100B0N)) FI(OUTDD) OLD"
"ALLOC DA('TSXAB1C.TEST.PGM(VP100B0T)') FI(INDD) SHR REUSE"
INP_RETURN_CODE = 0
EOFFLAG = 2
PROD_RETURN_CODE = 0
DOC_FOUND_LAG = 'N'
SECTION_FOUND_FLAG = 'N'
K = 0
J = 0
Z = 1
/* till this point it executes and then waits*/
"EXECIO 0 DISKR PRODD(OPEN"
"EXECIO * DISKW OUTDD (FINIS"
"EXECIO 0 DISKR INDD (OPEN"
SAY 'WAIT'

Gopi.
 
Hello Gopi,

You just open the file, but you do not read read them.

The manual say :


If you specify a value of zero (0), no I/O operations are performed
unless you also specify either OPEN, FINIS, or both OPEN and FINIS.

o If you specify OPEN and the data set is closed, EXECIO opens the
data set but does not read any lines. If you specify OPEN and the
data set is open, EXECIO does not read any lines.




If you want to read them use :

"EXECIO * DISKR PRODD(STEM DATA. FINIS "
IF RC ^= 0 THEN SIGNAL PB

"EXECIO * DISKR INDD(STEM DATA. FINIS "
IF RC ^= 0 THEN SIGNAL PB


"EXECIO * DISKW OUTDD (STEM DATA. FINIS"
IF RC ^= 0 THEN SIGNAL PB

"FREE F(OUTDD INDD PRODD)"

SIGNAL FIN
PB:
SAY 'PROBLEM DURING THE RUNNING CODE :'RC
FIN:

EXIT
 
The problem is you are using the data stack and it is waiting for a null input to end the DISKW. To fix this using your code do a QUEUE '' before your DISKW.

Personally, I recommend using STEMS as suggested by Tzu as they are much easier to use although the ability to PUSH and QUEUE your data stack can be very handy.
 
Thanks Tzu and KiwiREXXDude. I finally used stems and it worked fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top