IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to find a CICS resource used in CICS ENQ command?


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Thu Sep 29, 2016 1:45 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Sep 29, 2016 1:56 pm
Reply with quote

enq/deq logic is just a gentlemen's agreement between partners in crime icon_cool.gif

the resource name is only an arbitrary string, agreed upon by all the actors sharing <something>
Back to top
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Fri Sep 30, 2016 9:39 am
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Sep 30, 2016 2:30 pm
Reply with quote

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
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Fri Sep 30, 2016 6:19 pm
Reply with quote

I am getting it now. icon_smile.gif.

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Sep 30, 2016 6:43 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Sep 30, 2016 6:50 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Fri Sep 30, 2016 8:25 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Sep 30, 2016 10:20 pm
Reply with quote

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 icon_cool.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
Search our Forums:

Back to Top