View previous topic :: View next topic
|
Author |
Message |
Arunkumar Chandrasekaran
New User
Joined: 01 Jun 2010 Posts: 63 Location: India
|
|
|
|
Hi,
In my shop, one of the program i found the below.
EXEC CICS ENQ
RESOURCE(RESOURCE-NAME)
LENGTH(RESOURCE-LENGTH)
END-EXEC.
RESOURCE-NAME is having the value 'F5750I20-ENQ-LOADPRC'.
I couldn't understand what is the resource is? Is there any way to find the definition of a CICS resource?
Note: Earlier i have used ENQ only for programs.
Thanks,
Arun |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10891 Location: italy
|
|
|
|
enq/deq logic is just a gentlemen's agreement between partners in crime
the resource name is only an arbitrary string, agreed upon by all the actors sharing <something> |
|
Back to top |
|
|
Arunkumar Chandrasekaran
New User
Joined: 01 Jun 2010 Posts: 63 Location: India
|
|
|
|
Sorry I am not still clear.For example if I ENQ a program means I am holding the program from executing another copy.like that What I am achieving by holding the above resource.How do I find that What I am holding? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Quote: |
Sorry I am not still clear.For example if I ENQ a program means I am holding the program from executing another copy.
|
No, you are not preventing the program from executing another copy. All you are doing is signalling that you want to reserve 'something' that you;ve named. If others ignore the reserve you've placed, there's no effect. If others also issue an ENQ for the same 'something', they get suspended until you issue a DEQ.
Garry. |
|
Back to top |
|
|
Arunkumar Chandrasekaran
New User
Joined: 01 Jun 2010 Posts: 63 Location: India
|
|
|
|
I am getting it now. .
but for a confirmation Say I ENQ a program name (PGMA) from a program B.But When Program C tried to execute PGMA with out any ENQ it will still run.If PGMC tried to ENQ PGMA then it will fail.
So, physically ENQ is holding nothing. it is a just logical concept so that we can eliminate some concurrent processing. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
When using an ENQ "RESOURCE" API, the named defined to this RESOURCE must be known by all programs that attempt access. For example, if you have a TSQ which is accessed/updated by several programs, to ensure data integrity, a given program MUST serialize TSQ access. This would be the purpose of the ENQ API. It is highly suggested when serialized access has completed and you're ready to allow access by the "next" waiting-task, rather than wait for task-termination, issue an explicit DEQ API.
I still prefer using the HANDLE CONDITION ENQBUSY (LABEL), but that's just my preference.
If a program has issued an ENQ on a shared RESOURCE and it's busy, the program logic will automatically wait at the LABEL defined in the HANDLE until it becomes available.
HTH.... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
From the manual:
Quote: |
ENQ causes further execution of the task issuing the ENQ command to be synchronized with the availability of the specified resource; control is returned to the task when the resource is available.
A resource in the context of this command is any string of 1–255 bytes, established by in-house standards, to protect against conflicting actions between tasks, or to cause single threading within a program. |
So your statement
Quote: |
Say I ENQ a program name (PGMA) |
is inaccurate. You do the ENQ on a resource (string) you called PGMA. That resource has NOTHING to do with any program in the CICS region named PGMA. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3077 Location: NYC,USA
|
|
|
|
ENQ / DEQ is used for serialized access in a real-time world. Resource Name can be any string which is unique for that unit of work and remains alive with the token till transaction ends. So use of that is if any other transaction hits at the same time as first one then it is said to be Enq'ed till the very first issues DEQ or ends whichever is first.
I recall of ibmmainframes.com/viewtopic.php?t=64589&highlight= post. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10891 Location: italy
|
|
|
|
Quote: |
So, physically ENQ is holding nothing. it is a just logical concept so that we can eliminate some concurrent processing. |
that' s what we have been trying to tell for a while |
|
Back to top |
|
|
|