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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rexx on MVS question.

Status
Not open for further replies.

rmatthews

Technical User
Feb 13, 2007
3
US
Hi,

I am relatively new to REXX. I am trying to write an exec that is triggered by an AFOper trap. This exec will read a file and respond to a prompt on the OS390 console.
Currently, I am just trying to read the file, but I keep getting an error code 16.

DATASET = 'TEST.FILE'
ADDRESS ISPEXEC
"ALLOC DD(DATASET) F(ATHIN) SHR REUSE"

"EXECIO * DISKR ATHIN (STEM IN. FINIS)"

DO CNT = 1 TO IN.0
NUMBER = IN.CNT
END

Can someone please help?

Thank you,

 

ALLOC and EXECIO are 'address TSO' commands. There is nothing specifically ISPEXEC in the example to gave. I would however have expected a RC(-3) from trying to ALLOC in ISPEXEC...


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Oh, there's something else...
Code:
"ALLOC DD(DATASET) F(ATHIN) SHR REUSE"
"DD" and "F" (or FI or FILE) are synonyms of each other. You're trying to do an ALLOC with two DDnames and no dataset names. Try
Code:
"ALLOC FI(the-ddname) DA(the dataset-name) SHR REU"


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Thank you. Sometimes just can't see the forest for the trees.
 
Hello all,

I am having trouble reading a file on tso. It looks like it is allocating the dataset, but not reading it.

This is the code:
"ALLOC DD(INFILE) DSN('USER.TEST.MAIN.TESTFILE') SHR"
"EXECIO 1 DISKR INFILE (STEM RECORD. FINIS"

PULL RECORD.1
SAY RECORD.1

"FREE FILE(INFILE)"

Is there something that I am missing?

Thanks,
 
remove the PULL. It isn't needed. The PULL will overwrite what you read in!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top