Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 56
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: 8390
Location: Dubuque, Iowa, USA

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: 8390
Location: Dubuque, Iowa, USA

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: 56
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: 2090
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: 8390
Location: Dubuque, Iowa, USA

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: 2504
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: 8390
Location: Dubuque, Iowa, USA

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: 2015
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: 56
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 How to find if segment is read in any... Priyanka AR IMS DB/DC 3 Thu Sep 20, 2018 1:34 pm
No new posts U0437 to execute IMS DC program Vkp321 IMS DB/DC 6 Wed Sep 19, 2018 8:39 pm
No new posts Send data from a CICS TS program to M... spiThingy CICS 2 Wed Aug 08, 2018 8:58 am
No new posts Error while initiation CICS program f... Ashishpanpaliya CICS 3 Mon Jul 16, 2018 5:12 pm
No new posts In which program the FILE CONTROL wil... Poha Eater COBOL Programming 2 Thu Jun 28, 2018 9:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us