CICS ENQ/DEQ will work successfully as long as no SYNCPOINT is issued in the
running task.  The SYNCPOINT will commit all records updated thus far and
will release all explicit and implicit ENQ's.  Implicit ENQ's exist for any
record read for update and still not released or rewritten.  Here is another
pseudo-code technique that will work:

Use a TSQ RECNO (1) to hold the task number of the transaction you wish to
single thread.

.LOOP
        The starting program would read the TSQ RECNO (1)
        If EIBRESP equal DFHRESP (NORMAL)
                go to .TEST
        else
                go to .PROCEED
        end-if.

.TEST
        Check the task number retrieved from TSQ RECNO (1) to see if the
task is running
        If the task is still active
                DELAY task for a second or two and
                go to .LOOP
        else
                DELETE the TSQ and ignore any response
        end-if.

.PROCEED
        Create TSQ RECNO (1) with our EIBTASKN.
        .
        .
        .
        LINK to your program (XXXXXXXX)
        DELETE the TSQ and ignore any response
        .
        .
        .
        Go forth and do good...
        .
        .
        .


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of John Weber
Sent: Friday, July 08, 2011 4:07 PM
To: [email protected]
Subject: Re: ENQ/DEQ for CICS Transaction ID - now for Shared Resource

I appreciated all of the good and prompt responses.  It was really
appreciated.  I did try 'task' just now with the same result.  But this may
just be the way our logic is coded.

Now we are trying the approach of a shared resource ENQ/DEQ.  We will test
two transactions calling a transaction that ENQ's a resource.  This SHOULD
cause the one transaction to wait until the other is DEQ'd.

I'm not too CICS savvy, but how do you define a small field that is shared
between transactions (does anyone have an example), and do you refer to that
field in the ENQ by name and length (again, an example would be most
helpful)?

Thanks again! 

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of John Weber
Sent: Friday, July 08, 2011 12:08 PM
To: [email protected]
Subject: ENQ/DEQ for CICS Transaction ID

We are looking to restrict a transaction from being run concurrently.  We
have launched two other transactions (the code below) that ENQ/DEQ this one
transaction.  Using displays we were expecting to see all of the displays of
these two other transactions to follow one after the other; instead they are
mingled.  This suggests that they didn't run one after the other.

Is the following code sufficient or even unworkable?  I have read that
ENQ/DEQ can be used for transactions and not only with shared memory
resources. 

Also, does some other ENQ information need to be set up?  

Thank you so much...

XXXX refers to the transaction id and XXXXXXXX refers to the program
associated with this id.

 000024            EXEC CICS
 000025               ENQ RESOURCE(XXXX)
 000027                   RESP    (WS-CICS-RESPONSE)
 000028            END-EXEC

 000038            EXEC CICS
 000039               LINK PROGRAM('XXXXXXXX')
 000040               RESP        (WS-CICS-RESPONSE)
 000041               COMMAREA    (WS-PARAMETER)
 000042            END-EXEC

 000044            EXEC CICS
 000045               DEQ RESOURCE(XXXX)
 000046                   RESP    (WS-CICS-RESPONSE)
 000047            END-EXEC

----------------------------------------------------------------------
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

----------------------------------------------------------------------
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

----------------------------------------------------------------------
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