ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » MQseries- writing record in vsam as soon as read form MQ

Post new topic  Reply to topic
 MQseries- writing record in vsam as soon as read form MQ « View previous topic :: View next topic » 
Author Message
bijal.awhad
PostPosted: Mon Dec 08, 2008 12:25 am    Post subject: MQseries- writing record in vsam as soon as read form MQ Reply with quote

Newbie

Joined: 08 Dec 2008
Posts: 3

Hi

I want to write the message that has been read from Q in vsam file.
Program logic is as below
1. Open Q
2. Read Q
3.Close Q
4. Write to Vsam file

Now what is happening is as soon as messgae is read from the Q , that messgae is no longer available in Q.Now if in case if message is not written to vsam (due to some error) i will miss the record as it is not available in Q any more.

Requirement is The read transaction should not be completed successfully until the record is written to the VSAM file. If the read transaction does not complete, the record should remain on the queue.

Is there any way to keep the message in the Q when there is an error while writing to vsam and delete the message from Q when vsam write is successful.

How should i do this? I am new to MQ. If i get sample code that will be great help..

Thanks
Bijal
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 08, 2008 12:32 am    Post subject: Re: MQseries- writing record in vsam as soon as read form MQ Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bijal.awhad wrote:
Now what is happening is as soon as messgae is read from the Q , that messgae is no longer available in Q.Now if in case if message is not written to vsam (due to some error) i will miss the record as it is not available in Q any more.


Not if you use syncpointing.

bijal.awhad wrote:
How should i do this? I am new to MQ. If i get sample code that will be great help..


You should read the Application Programmer's Guide.

You'll find sample code included with your WMQ installation, and also by following the link at the top of this page.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bijal.awhad
PostPosted: Mon Dec 08, 2008 1:57 am    Post subject: You should read the Application Programmer's Guide Reply with quote

Newbie

Joined: 08 Dec 2008
Posts: 3

Do you have any link for this ?
Back to top
View user's profile Send private message
exerk
PostPosted: Mon Dec 08, 2008 2:45 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

Vitor wrote:
You'll find sample code included with your WMQ installation, and also by following the link at the top of this page.

_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 08, 2008 2:59 am    Post subject: Re: You should read the Application Programmer's Guide Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bijal.awhad wrote:
Do you have any link for this ?


Look up - you'll see links for sample code and the documentation.

You'll also find both on the web, and included with your installation.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Dec 08, 2008 3:14 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

MQGMO_SYNCPOINT on the MQGET

then MQCMIT after the successful VSAM write.

However you should inspect the message backout count to prevent a loop.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Dec 08, 2008 6:24 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

VSAM is single-phase comit by default. You will need to look at implementing transactional VSAM (CICSTVS) to be able to comit/backout mq gets/puts with VSAM activity.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Jan 27, 2009 12:43 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Transactional VSAM.....who would have thought it!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » MQseries- writing record in vsam as soon as read form MQ
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.