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

Allocating Output Files Without Dataset Name in REXX

Status
Not open for further replies.

bkjanes

Programmer
Jun 7, 2012
3
US
I have a REXX EXEC that will be executed on a Z/OS mainframe in batch mode using the TSO utility IKJEFT1A, and would like to be able to allocate the output file in the EXEC using only the DD name coded in the JCL, without having to refer to the dataset name. Is this possible in REXX?
 
Well, no. The JCL has already requested that the system allocated the file to your program step so you do not need to allocate it. That is what JCL is for - amongst other things.


Nic
 
Why does someone believe this might be desirable?

You might consider removing the DD statement and look into dynamically allocating the dataset. . .
 
The JCL has already requested that the system allocated the file to your program step so you do not need to allocate it. That is what JCL is for - amongst other things."

Exactly! Which is why I don't want to have to worry about coding a DSN - my JCL has already done that. But it seems that the ALLOC command requires it, otherwise I get an error message that says "FILE MYDDNAME NOT ALLOCATED, FILE IN USE". My REXX EXEC is able to write to the file that I allocated by DD name, so I'm getting the output that I need, but I'd like to avoid getting that ugly error message.

I realize that ALLOC is a TSO command, and not an actual REXX command. But since this is in a REXX EXEC, I thought someone out there might know of away to use ALLOC to allocate the output file by DD name alone, without the DSN.
 
Whay are you using the ALLOC command? Your dataset is already allocated - you do not need to use the allocate command when JCL allocates for you. Remove it - or remove the JCL DD statement.


Nic
 
I remember when I was a very new programmer back in 19mumble and my utter shock when I discovered that, unlike JCL where the program is named first and its assets later, in CLIST one had to allocate all the assets BEFORE invoking the program. Later I learned that even though "EXEC PGM=" is the first line of a step, it's actually the last line processed.

I think something of that sort is going on here. BKJanes has internalized the notion that all the assets have to be allocated but is having trouble with the notion that allocation can happen in different places for different assets. S/he has also not developed the knack of reading exactly what the message says. In this case, the message says: "FILE MYDDNAME NOT ALLOCATED, FILE IN USE". Not dataset in use, file in use. In other words, the file has already been allocated via JCL before this REXX routine started and there is no need to do it over again unless the allocation in the JCL is wrong.

Frank Clarke
--America's source for adverse opinions since 1943.
 
Got it. I removed the ALLOC from the REXX EXEC and it worked like a charm. Thanks for the comments and suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top