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

How to check if an input message IMS queue is empty


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Fri May 08, 2009 1:57 pm
Reply with quote

Hello,
I need to know, from an application program, if there are any message left in the the input queue of an IMS transaction to issue a End-Process event.
So I wander if it is possible check (in an application pgm) if an input IMS queue is completely empty. I coudn't find any positive response.
Can any of you help me on this issue.

Thanks & Regards.
CasGraci.
Back to top
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Fri May 08, 2009 3:45 pm
Reply with quote

Have you tried CMD call in an application program?
Back to top
View user's profile Send private message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Fri May 08, 2009 4:36 pm
Reply with quote

No, can you explain a little bit what is a CMD call or refer some documet please?.
Thanks.
CasGarci
Back to top
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Fri May 08, 2009 5:34 pm
Reply with quote

I used to use this function for stopping and starting DBs from program.
Please refer following:
publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.ims10.doc.apr/p3hwdlitm.htm
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Fri May 08, 2009 9:52 pm
Reply with quote

If I am not wrong, does not status code of QC or QD help us to check if there any messages waiting to be read?

-Ajay
Back to top
View user's profile Send private message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Tue May 12, 2009 1:08 pm
Reply with quote

Hi all,
CMD call is not indicate to check if a queue is empty.
Regarding IMS return codes: QC or QD they don't guaranty that the queue is empty. IMS scheduler can return a QC to the application pgm just because priorities reasons and still there are message left in the transaction queue to be processed later.

Thanks for your help.
Any other ideas?

Regards.
CasGarci.
Back to top
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Wed May 13, 2009 12:04 am
Reply with quote

Hello CasGarci,

I am not quite sure what you are facing.
What are the results of CMD call and which IMS command did you use in order to find your queue?

Please refer below and remember to use GCMD as well, copied from manual:
---------------------------------------------------
CMD call

The Command (CMD) call enables an application program to issue IMS commands.

Usage

Use the CMD call with the GCMD call to send commands to and receive responses from IMS TM. After the CMD call issues the command to IMS TM, IMS TM processes the command and returns the first segment of the response message to the application program's I/O area, but only if a CC status code is returned on the CMD call. Your application program must then issue GCMD calls to retrieve all subsequent message segments one segment at a time. For more information, see GCMD call. The CMD and GCMD command calls are typically used to perform functions that are usually handled by someone at a terminal. These programs are called automated operator (AO) applications.

Related reading: For more information on the automated operator interface (AOI), see IMS Version 10: Exit Routine Reference.

Before you issue a CMD call, the IMS command that you want to execute must be in the I/O area that you refer to in the call. When you issue a CMD call, IMS TM passes the command from the I/O area to the IMS control region for processing. IMS TM places your application program in a wait state until the command is processed. The application program remains in a wait state until IMS TM returns a response. (Response means that IMS TM has received and processed the command.) For asynchronous commands, you receive a response when the command is processing, but not when it is complete.

Restrictions

The AIB must specify the I/O PCB for this call.

Any application program that uses this call must be authorized by the security administrator.
You cannot issue a CMD call from a CPI-C driven application program.
This call is not supported in an IFP or non-message-driven BMP.
Back to top
View user's profile Send private message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Wed May 13, 2009 2:35 pm
Reply with quote

Hi dominickim,
I am looking for a way to check from an application program if its associted IMS input queue is empty. That's there isn't any message left in the program input queue waiting to be processed.

IMS is aware when a queue pass from empty to no-empty and when this happend the scheduling start working, in order to dispatch the input messages.
¿Is there a way to 'ask IMS' if an input queue es empty? so no message is left for processign.

I check in the funcionality of 'CMD call' but i didn't find the requested funtion.

Regards.
CasGarci.
Back to top
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Wed May 13, 2009 3:11 pm
Reply with quote

Hello CasGarci,

Output of /DIS TRAN your-tran or /DIS Q TRAN command in IMS work for you?
But you have to remember that someone can enter the transaction(s) while are you examining the queue.

Dominic
Back to top
View user's profile Send private message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Wed May 13, 2009 4:58 pm
Reply with quote

Thanks for your help dominickim,
Commands /DIS Q, /DIS QCNT looks very good.

Regards.
CasGarci.
Back to top
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Wed May 13, 2009 5:50 pm
Reply with quote

Why don't you use those commands in your application with CMD call?
Back to top
View user's profile Send private message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Thu May 14, 2009 12:23 pm
Reply with quote

Yes, this is what I think to do.

Regards.
CasGraci.
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 -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts omegamon for cics -UNSUPPORTED ENVIRO... CICS 2
No new posts External data queue (changes?) CLIST & REXX 0
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
Search our Forums:

Back to Top