AFAIK either the initiator does the ENQ (when there is a DD statement) OR 
dynamic allocation does the ENQ (when the code does a DYNALLOC). The same 
applies to the DEQ.

To avoid deadlocks the initiator does all ENQs ahead before starting the job. 
DYNALLOC returns "not available" when another task/job has the ENQ. This is 
often forgotten by REXX/CLIST and SAS coders, who assume they will get the 
dataset, when they allocate it dynamically.

Kees.

> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
> Behalf Of Seymour J Metz
> Sent: 11 February, 2019 17:41
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: DEQ dynamically
> 
> When the Initiator frees a dataset and no subsequent step has a DD for
> it, the Initiator does a DEQ. If there is a subsequent dynamic
> allocation, then the Initiator does a new ENQ; there's always a
> possibility that some other job will get there first.
> 
> BPXWDYN is just a fron end; ultimately it goes to the same DYNALLOC (SVC
> 99) as any other allocation.
> 
> GRS maintains a global reference count for any resource, not just
> SYSDSN.
> 
> 
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
> 
> _______________________________________
> From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf
> of Paul Gilmartin <0000000433f07816-dmarc-requ...@listserv.ua.edu>
> Sent: Monday, February 11, 2019 11:13 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: DEQ dynamically
> 
> On Mon, 11 Feb 2019 06:43:14 -0600, John McKown wrote:
> >
> >One thing that I sometimes do is include a FREE=CLOSE on a DD if I am
> >certain that the application will only read if once, say at start up,
> for
> >configuration information.
> >
> How does that work if a subsequent job step contains a DD statement for
> the same DSN?
> 
> I would guess that the control blocks for the job step (TIOT? JFCB?) are
> cleaned up but the initiator continues to hold the ENQ.
> 
> Or just a JCL error?
> 
> And something similar should apply to a BPXWDYN('free') of a DSN
> allocated
> by JCL.
> 
> And if a program redundantly ALLOCATEs then FREEs a DSN allocated in
> JCL?  Does GRS maintain a reference count of the ENQ QHAME/RNAME?
> 
> -- gil
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
********************************************************
For information, services and offers, please visit our web site: 
http://www.klm.com. This e-mail and any attachment may contain confidential and 
privileged material intended for the addressee only. If you are not the 
addressee, you are notified that no part of the e-mail or any attachment may be 
disclosed, copied or distributed, and that any other action related to this 
e-mail or attachment is strictly prohibited, and may be unlawful. If you have 
received this e-mail by error, please notify the sender immediately by return 
e-mail, and delete this message.

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
employees shall not be liable for the incorrect or incomplete transmission of 
this e-mail or any attachments, nor responsible for any delay in receipt.
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
Airlines) is registered in Amstelveen, The Netherlands, with registered number 
33014286
********************************************************

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to