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 » IBM MQ API Support » Basic Perl/MQ

Post new topic  Reply to topic
 Basic Perl/MQ « View previous topic :: View next topic » 
Author Message
musiccs
PostPosted: Wed Mar 31, 2004 8:57 am    Post subject: Basic Perl/MQ Reply with quote

Newbie

Joined: 31 Mar 2004
Posts: 5
Location: Brentwood

I have to create a perl script to PUT messages onto a MQ. This is for testing purposes and will be using hard-coded sample data to build up messages or a delimited flat file. I have never used or interfaced MQ before. Do you know where I can find sample code for this?

Any help would be much appreciated.

Thanks,
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Mar 31, 2004 9:03 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Try the "Repository" button at the top of the page.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
musiccs
PostPosted: Wed Mar 31, 2004 9:26 am    Post subject: Reply with quote

Newbie

Joined: 31 Mar 2004
Posts: 5
Location: Brentwood

I tried that, but it was not helpful. Thanks Eddie!
Back to top
View user's profile Send private message
bduncan
PostPosted: Wed Mar 31, 2004 10:32 am    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

WHAT?
Not helpful????
What the heck is the getput.pl program then?

Quote:
I have to create a perl script to PUT messages onto a MQ.


Jee, I realize it's not EXACTLY what you need line for line, but with a few changes you can get it to do what you want...
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
musiccs
PostPosted: Wed Mar 31, 2004 10:54 am    Post subject: Reply with quote

Newbie

Joined: 31 Mar 2004
Posts: 5
Location: Brentwood

Thats why you are the Grand Master and I am the newbie. What is a no-brainer for someone of your great magnitude of MQ skills, is certainly not mine. I thought this was a place to get help for MQ. Maybe I am missing something here. Maybe I should have been more specific. I apologize for not...I have a flat file with lines that are the following.

user@abc.com,yyyymmdd,hhmmss,yyymmdd,hhmmss,111.222.123.123,222.111.222.111,AAAXXXLLLL,AAAXXXLLLL,ANAMEFORTHIS

I am not familiar enough with MQ to know where/how these values would be stored in MQ.

Thanks!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Mar 31, 2004 11:13 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Presumably, you want to put each of those records onto a queue as a message.

So then modify the sample .pl program that has already been mentioned to change the contents of the data that it writes to the message object to the contents of one of your records. Then wrap the piece of code that creates a message and PUTs it in a loop that reads each of your records.

And it's not surprising that the answer to the question you asked - "where can I find a perl sample for putting messages on a queue" was not helpful in answering the question you meant to ask - "How do I use MQSeries to send my data?".

And the manual called "Application Programming Guide" is a good resource for learning how to write MQSeries programs. Also, there is a Support Pack called something like "MQSeries Primer" that may be of help. You can do a search on this website for "Support Packs" or "SupportPac" to find the link to the page on the IBM website that has support packs.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
oz1ccg
PostPosted: Wed Mar 31, 2004 12:58 pm    Post subject: Reply with quote

Yatiri

Joined: 10 Feb 2002
Posts: 628
Location: Denmark

If you just have to move that flatfile into a MQ queue.... I would offer you another link, because you would only have to write a single command to put the file into a WebSphere MQ queue....

Q -oQMGRA#QUEUE1< flatfile or
cat flatfile | Q -oQMGRA#QUEUE1
I haven't used the last one myself.

http://www.ibm.com/support/docview.wss?rs=203&uid=swg24000647&loc=en_US&cs=utf-8&lang=en

Description:
Quote:
Q takes messages from one source and outputs to a target. The operation of the pipe is controlled by switches to the program. The source and target can either be the console or a WebSphere MQ Queue. since input/output can be taken from stdin/stdout these can also be files. Two instances of Q can therefore be used to implement a primitive file transfer program.


I've created a "FTP to MQ" and visa versa application using the q-program. I only had to write some shell scripts to invoke the FTP and Q program to make it all work. This is just a creative inspiration.

I know it's more fun to write a new application, but it's easier to tak one of the shelf, and it's even tested

PS: we're all trying to help..... But we don't teach how to read, think, eat and drink. It requires a little work from you too.
Quote:
Thats why you are the Grand Master and I am the newbie. What is a no-brainer for someone of your great magnitude of MQ skills, is certainly not mine. I thought this was a place to get help for MQ


Just my $0.02
_________________
Regards, Jørgen
Home of BlockIP2, the last free MQ Security exit ver. 3.00
Cert. on WMQ, WBIMB, SWIFT.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
jefflowrey
PostPosted: Wed Mar 31, 2004 1:35 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The Q utility has some buffer limitations on record sizes - something like 5000 bytes or so.

At least, it did the last time I checked.

And to be clear, this buffer limitation isn't necessarily a bad thing - just something to be aware of.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bduncan
PostPosted: Wed Mar 31, 2004 1:52 pm    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

musiccs,
I guess my response was a tad too stern. I just get irritated when I feel like someone expects me to write an exact sample program for them (it's not exactly a "sample" anymore now is it?) As Jørgen points out, most of us will go a long way towards helping a newbie as long as we feel they are making an effort to meet us partway...
Without even knowing exactly how to code this program, you should be able to think about *what* it should do.
For instance, do you want to a) send the entire flat file as a single message, or b) send each line in the flat file as a separate message.
Also, your statement
Quote:
I am not familiar enough with MQ to know where/how these values would be stored in MQ.
makes me wonder if you even want to use MQSeries for this. When you say "stored" it makes me think that you are trying to use MQSeries as a data repository - and that's what a database is for, not messaging middleware.
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
musiccs
PostPosted: Thu Apr 01, 2004 9:37 am    Post subject: Reply with quote

Newbie

Joined: 31 Mar 2004
Posts: 5
Location: Brentwood

Man Brandon...you are tough as nails! Are you related to my boss by any chance?....haha! Yeah, not only was I not specific, but I used wrong terms. Yeah, a flat file in which that each line would be a new message. And NOT stored on MQ, but PUT. Another process is going to GET the messages, run some additional processing and store them in a Database. And my thought originally was hoping that someone out on the forum here would have done something like this before. Have you ever been slammed with a task that you no little about, and asked to get it done yesterday? Yeah, I think we all have at one time or another...well that is my task for this Friday so thats where I am coming from.....Thanks for all your input too....I will look at all the resources mentioned in the chain. In the meantime if anyone has done this before and wants to chime in, GREAT!
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 » IBM MQ API Support » Basic Perl/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.