Paul Gilmartin said:
the initiator
was able to allocate it again in STEP2.  I hope this was
not done without an ENQ.

Right, but maybe the intervening de-allocate was done without a DEQ.

Besides, the message "IKJ56247I FILE SYSUT1 NOT FREED, IS NOT ALLOCATED" may not come to pass the way you think. It says that the *ddname* is no longer allocated. A better test might be via the command "free da('FOO.BAR')".

In any event, I believe the alloc and free commands are probably driven off the DSABQ; the first free removes the DSAB, the second one does not find it. Whether the dataset remains allocated or, more to the point, enqueued, is another matter.





From: Paul Gilmartin <[EMAIL PROTECTED]>
Reply-To: IBM Mainframe Discussion List <IBM-MAIN@BAMA.UA.EDU>
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: Why is there JOB scope for DSN ENQ's anyway?
Date: Fri, 25 May 2007 13:48:43 -0500

On Fri, 25 May 2007 14:14:44 -0400, Bruce Black wrote:
>
>As far as a EXC-SHR function, this also seems obvious to me.  The
>initiator ENQs the dataset, and then releases the dataset at the end ofVVe
>the last step that uses it.  If you issue a EXC-SHR request, a fullowing
>step may need the dataset exclusive and you have now compromised the
>dataset.  There is no easy way that I know to determine if the current
>step is the last step that uses the dataset.
>
Apparently the initiator is up to the task, easy or difficult.
The JCL fragment:

    //*
    //STEP1    EXEC  PGM=IKJEFT01
    //SYSUT1    DD   DISP=OLD,DSN=FOO.BAR,
    //  UNIT=SYSALLDA,VOL=SER=TSO001
    //SYSTSPRT  DD   SYSOUT=(,)
    //SYSTSIN   DD   *
        free dd(sysut1)
        free dd(sysut1)
    //*
    //STEP2    EXEC  PGM=IKJEFT01
    //SYSUT1    DD   DISP=OLD,DSN=FOO.BAR,
    //  UNIT=SYSALLDA,VOL=SER=TSO001
    //SYSTSPRT  DD   SYSOUT=(,)
    //SYSTSIN   DD   *
        free dd(sysut1)
        free dd(sysut1)
    //*

produces SYSTSPRT from STEP1

    READY
        free dd(sysut1)
    READY
        free dd(sysut1)
    IKJ56247I FILE SYSUT1 NOT FREED, IS NOT ALLOCATED
    READY
    END

... and  SYSTSPRT from STEP2

    READY
        free dd(sysut1)
    READY
        free dd(sysut1)
    IKJ56247I FILE SYSUT1 NOT FREED, IS NOT ALLOCATED
    READY
    END

... so even though FOO.BAR was FREEd in STEP1, the initiator
was able to allocate it again in STEP2.  I hope this was
not done without an ENQ.  Whatever technique the initiator
used here, it could use the same technique to differentiate
an EXC from A SHR ENQ.

-- gil

_________________________________________________________________
PC Magazine’s 2007 editors’ choice for best Web mail—award-winning Windows Live Hotmail. http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_pcmag_0507

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

Reply via email to