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
 

 

Using ENQ in one program and DEQ in another.

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

New User


Joined: 22 Feb 2010
Posts: 47
Location: Cochin

PostPosted: Sat Jul 25, 2015 2:47 am    Post subject: Using ENQ in one program and DEQ in another.
Reply with quote

Hi,

I am using ENQ in one of the program as below and trying to use DEQ in another for the same Resource Value.

ENQ Value in both cases is exactly same. Is it allowed to ENQ in one program and DEQ in another both programs running in same LPAR ?

In Program 1 I am using :

Code:
EXEC CICS                       
     ENQ                       
     RESOURCE (WS-ENQ-VALUE)   
     LENGTH   (WS-ENQ-LENGTH)   
     RESP     (WS-RESP)         
     TASK                       
     NOSUSPEND                 
END-EXEC.                       


In Program 2 I am using :

Code:
EXEC CICS DEQ                     
     RESOURCE (WS-ENQ-VALUE)     
     LENGTH   (WS-ENQ-LENGTH)     
     RESP (WS-RESP)               
END-EXEC.                         
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Sat Jul 25, 2015 3:24 am    Post subject:
Reply with quote

ENQ and DEQ are supposed to work as a pair in a program. Depending upon the specific situation, what you are wanting to do may - or may not - work.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Sat Jul 25, 2015 5:56 am    Post subject:
Reply with quote

Also, I notice that you did NOT indicate you are having any issues, nor what the RESPONSE codes are for each command, you just asked if it is allowed. And the answer is generally, as long as the programs are in the same task / UOW (depending upon the ENQ parameter) then it should work -- but I haven't tested this so I don't know for sure. If the programs are not in the same task / UOW, then almost certainly what you are attempting to do will not work. As I posted earlier, it may -- or may not -- work depending upon the specific situation.

And your question is quite broad -- two programs running in the same LPAR could be running in different CICS regions, in which case the answer, of course, will be that this CANNOT work since the programs CANNOT be in the same task / UOW.
Back to top
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 47
Location: Cochin

PostPosted: Sat Jul 25, 2015 9:48 am    Post subject: Reply to: Using ENQ in one program and DEQ in another.
Reply with quote

Sorry for not being specific. Both the programs run in the same CICS region. In that case the above scenario should work right ?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Sat Jul 25, 2015 2:11 pm    Post subject:
Reply with quote

Why not try it and find out? That is what test regions are for.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Sat Jul 25, 2015 5:52 pm    Post subject:
Reply with quote

Quote:
In that case the above scenario should work right ?
How many times do you want the question answered? It may -- or may not -- work depending upon the specific situation. As Nic said, test it yourself so you will know the answer.
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: Mon Jul 27, 2015 6:26 pm    Post subject: Reply to: Using ENQ in one program and DEQ in another.
Reply with quote

I agree with the previous consensus. The same ENQ resource matched with the same DEQ resource in different regions (within the same LPAR) will not work. If in the same region, I don't see a problem.

Internal Resource Tables are Region specific. Unfortunately, there isn't a SYSID keyword option in the ENQ/DEQ API's.

What are you attempting?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Mon Jul 27, 2015 7:39 pm    Post subject:
Reply with quote

seahawk789: What you have not explained is how program 1 and program 2 are related. I think you want a simple yes / no answer, but you cannot have a yes / no answer because the answer depends upon how the programs are related. If they are totally distinct and separate (as in running in two different tasks), I believe you will find this won't work since the end of task will release the ENQ without requiring the DEQ to process -- and therefore the DEQ would not have a normal response since there's no associated ENQ. If program 1 and program 2 are both associated with a single task (via XCTL or LINK) then yes it will work as long as there's no intervening EXEC CICS RETURN to force the end of task.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Mon Jul 27, 2015 8:26 pm    Post subject:
Reply with quote

That should work, and however if the previous ENQ task is completed (XCTL) or any Syncpoint is issued then, it anyways gets deq'ed by default.

Moreover, please go through this to understand the scope of ENQ'ed transaction.

http://www-01.ibm.com/support/knowledgecenter/#!/SSGMCP_4.2.0/com.ibm.cics.ts.applicationprogramming.doc/topics/dfhp3ly.html?cp=SSGMCP_4.2.0%2F11-3-5-2-2

http://www-01.ibm.com/support/knowledgecenter/#!/SSGMCP_5.1.0/com.ibm.cics.ts.applicationprogramming.doc/commands/dfhp4_deq.html
Back to top
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 47
Location: Cochin

PostPosted: Wed Jul 29, 2015 6:32 am    Post subject:
Reply with quote

Thanks all for your help.
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 IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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