On Fri, 22 Jul 2011 16:18:15 -0400, Jim Mulder wrote:

>IBM Mainframe Discussion List <IBM-MAIN@bama.ua.edu> wrote on 07/22/2011
>03:38:55 PM:
>
>> What about a driver program which OPENs a DD name then ATTACHes the
>> actual "main" routine with the DCB=. This driver has an API such
>> that a subtask can request the driver program, in its TCB, do a
>> CLOSE / DEALLOCATE / ALLOCATE / OPEN of the DCB which it used in the
>> ATTACH? Granted, this is likely very dangerous due to timing issues
>> (or ENQ SMC). But does the IBM documentation explicitly say that the
>> parent TCB cannot do this? "That which is not specifically
>> forbidden, is allowed."
>>
>> <quote>
>> ,DCB=dcb addr
>>     Specifies the address of the data control block for the
>> partitioned data set containing the entry name.
>>
>>     Note: The DCB must be opened before the ATTACH macro is issued
>> and must be the DCB used in the BLDL that built the 62-byte DE list
>> entry. The DCB must remain open until the subtask becomes active,
>> and it should not be closed immediately following the ATTACH.
>>
>>     Note: DCB must reside in 24-bit addressable storage.
>> </quote>
>>
>> seems vague to me. Is the DCB actually used? Or the DEB pointed to
>> by the DCB? The above says "should not be closed immediately". How
>> long after the ATTACH? Or should it say only after the subtask terminates?
>
>  The DCB is used for fetching the module which is the target
>of the ATTACH.  This fetching is done under the newly created
>task.  So "how long" would be "not until the fetching of the
>module has completed".  If the module is fetched from a PDS,
>then you would know that the fetching has completed when the
>module gets initially entered.  If the module is fetch from a PDSE,
>and has the attributes with allow page-mode loading, then you don't
>have a way to know when fetching as completed, so you should close
>the DCB only after the subtask terminates.
>
This feels like grounds for an RCF; almost as if the manual were
written before the advent of PDSE.  And rather than dancing about
trying to define "immediately" and enumerate the complex (and
variable) conditions under which the DCB may be closed, it would
be better to say, "If the DCB is closed before the subtask terminates
(is DETACHed?), the results are unpredictable."

In a more conservative, developer-friendly universe, to CLOSE
the DCB before the subtask terminates would cause an ABEND,
regardless of PDS, PDSE, or page-mode loading.

(I'm thinking of that hypothetical developer-friendly universe in
which REFR modules would unconditionally be loaded in write
protected pages.)

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to