Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I frequent other newsgroups, too, and am MOST IMPRESSED with the lack of smart a-- and presence of genuine desire to help anyone of any skill level..."

Geography

Where in the world do Tek-Tips members come from?

Allocating Output Files Without Dataset Name in REXX

bkjanes (Programmer)
7 Jun 12 12:55
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?
nclouston (Programmer)
7 Jun 12 13:44
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

papadba (MIS)
7 Jun 12 14:00
Why does someone believe this might be desirable?

You might consider removing the DD statement and look into dynamically allocating the dataset. . .
bkjanes (Programmer)
7 Jun 12 14:16
"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.
nclouston (Programmer)
8 Jun 12 1:52
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

rexxhead (Programmer)
8 Jun 12 9:58
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.

bkjanes (Programmer)
8 Jun 12 20:36
Got it. I removed the ALLOC from the REXX EXEC and it worked like a charm. Thanks for the comments and suggestions.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close