Question is: do you want to be able to read the file in the batch job before 
the CLIST is finished? Or after the CLIST is finished? Or both?

What is happening is (and some of this, if not all, has been recognized by 
other responders):

1. Your CLIST allocates the file to DD I7010201 as NEW, with a disposition of 
DELETE.

2. At this point your file is exclusive to your TSO step, because NEW is like 
OLD. You won't be able to use it in the batch job.

3. Ending the CLIST will not change this. It is still allocated to the TSO 
session, exclusively.

4. When you end the TSO session, at that point it deallocates the file. Since 
it is a disposition of DELETE, the file is deleted.


If you want to keep the file at the end of the CLIST and then read it in the 
batch job, then you need to:

   a. Remove the DELETE from the ALLOCATE so it keeps the file
   b. And, FREE DD(I7010201) at the end of the CLIST. That will release it from 
the TSO session, and then you'll be able read it in the batch job.


If you want to be able read the file while the CLIST is running:

   a. Remove the DELETE from the ALLOCATE
   b. After you allocate it, FREE DD(I7010201).
   c. Then reallocate it: ALLOC DD(I7010201) DSN('IFU05.BMF701.C39.O7010111') 
SHR. Now it is allocated shared and the batch job can read it.
   d. At the end of the CLIST, FREE DD(IFU05.BMF701.C39.O7010111). That's just 
good practice.
   e. If you want to delete it, you could have allocated it as SHR DELETE in 
step c, or just DELETE it at the end. It is possible to combine the DELETE and 
FREE in one command.

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Joseph Reichman
Sent: Thursday, July 17, 2025 10:32 AM
To: [email protected]
Subject: Re: Contention problem TSO and batch job

This is from my job at the irs so I can’t cut and paste as I have trouble
sending outbound email
From [email protected]

So here goes

 ALLOC FI(‘O7010111) NEW CATALOG DELETE
DA(‘IFU05.BMF701.C39.O7010111’) USING(DCBPARAM) SPACE(15,15) CYLINDERS
STORCLAS(STANDARD) MGMTCLAS(MTSOPRM)



ATTRIB DCBPARM RECFM (V B) LRECL(31996)
BLKSIZE(32000) DSORG(PS)


In the batch job after I finish with clist

I have //I7010201 DD DSN=IFU05.BMF701.C39.O7010111,DISP=SHR

There is a contention message

As the job is held

When I log off tso and back on it is deleted

Thanks




On Thu, Jul 17, 2025 at 11:17 AM Charles Mills <[email protected]> wrote:

> Oh Joe, Joe, Joe, ...
>
> Specifics, specifics, specifics, ...
>
> What is the exact allocation of the file in question?
>
> CM
>
> On Thu, 17 Jul 2025 11:09:47 -0400, Joseph Reichman <[email protected]>
> wrote:
>
> >Hi
> >
> >I have a clist which I allocate an output file used to debug a program
> under TSO TEST
> >
> >When that clist ends I would like to use the file in a batch job
> >
> >However I get a contention error
> >
> >When I free it or log off tso the file gets deleted
> >
> >Don’t understand this
> >
> >Can this be installation specfic
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to