Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ENQ use in CICS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
akodakka

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Fri Nov 30, 2012 9:26 pm    Post subject: ENQ use in CICS
Reply with quote

Hi All

I have checked manuals and previous to get the answer but didn't clear still.

Regarding the resource that we mention in ENQ. As per my understanding the RESOURCE in an ENQ can be a VSAM file , a storage , etc.

The resource that is to be enqueued on must be identified by one of the following methods:

Specifying a data area that is the resource. It is the location (address) of the data area in storage that is important, not its contents. Two tasks, enqueuing on the same resource and using this method, must refer to the same location in storage. They could both, for example, refer to the same location in the Common Work Area (CWA).
EXEC CICS ENQ
RESOURCE(RESNAME)

Specifying a data area that contains a unique character string argument (for example, an employee name) that represents the resource. It is the contents of the data area that is important, not its location. Two tasks, enqueuing on the same resource and using this method, can refer to the same location or different locations, but the contents of the locations must be the same. The length must be supplied in the LENGTH option and can be up to 255 bytes long.
EXEC CICS ENQ
RESOURCE(SOCSECNO)
LENGTH(8)

here my query is ENQ a data area which contains a character string. I have program where i ENQ a resource like

01 WS-RESOURCE PIC X 10 VALUE 'ABCDEFG'


and in my program i am ENQ uing the same

EXEC CICS ENQ
RESOURCE (WS-RESOURCE)
LENGTH(LENGTH OF WS-RESOURCE)
END-EXEC


What will be the relevance of ENQ uing a data string here.? Any thoughts?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri Nov 30, 2012 9:39 pm    Post subject:
Reply with quote

From the description of ENQ in the CICS Application Programming Reference manual, 1.75, with emphasis added by me:
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.
I suspect you mis-understand the resource in the ENQ command: if it is a VSAM file name, it does NOT represent the actual VSAM file that CICS has defined -- it is an 8-byte variable that happens to be the same bytes used by CICS to reference a file.
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Fri Nov 30, 2012 11:19 pm    Post subject:
Reply with quote

Normally you dont have use END/DEQ. The END/DEQ can be used when you want to ensure "something" isnt referenced/changed by more than one task at a time e.g. values in CWA, as the CWA is not a "protected resource" in CICS. For files etc the "protection" is handled by CICS without any special programming. This is one of the objectives of a "Transation Processing" system.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Dec 01, 2012 12:40 am    Post subject:
Reply with quote

Hello,

Why does someone believe you need to implement your own enque?
Back to top
View user's profile Send private message
akodakka

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Sat Dec 01, 2012 2:31 am    Post subject:
Reply with quote

Hi all,

Thanks everyone..yes i missed the context highlighted by Robert.

I was doing some research on the CICS API commands by digging through the programs that has been using in my shop.Thanks again..really helped me to understand the ENQ.

I hope i will be able to answer these type of questions in near future:)
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Sat Dec 01, 2012 2:45 am    Post subject: Reply to: ENQ use in CICS
Reply with quote

If you do need to use an ENQ/DEQ Resource, it would be in your best interest to define the resource-name, using a combination of upper/lower case letters, numeric values, along with special characters in an attempt to make it as unique as possible. EG:

'$@My-Resource-Name-001@$'

Doing this will reduce other creative minds in your shop from duplicating the name.

One last thought; Once you're done with accessing the resource and you're not at task termination, issue a DEQ.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS Transaction Timeout Hooman24 CICS 2 Sun Apr 16, 2017 2:16 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us