Bobbee, Would you settle for Perl if no MQSeries module was required?
#!/usr/bin/perl -w #----------------------------------------------------------------------# # trigger.pl # # Script parses a WMQ TMC2 tigger message and runs the application as # specified in the process definition. Uses unpack so that the MQSeries # Perl module is not required. # # The command constructed from the process definition is as follows: # $ApplId $QName $QMgrName $EnvData # # The $UserData field is not currently used. # #----------------------------------------------------------------------# # History # 2004/05/04 T.Rob - New script # # #----------------------------------------------------------------------# use strict; $| = 1; # Turn on Autoflush my $Testing = 1; # Trigger Message struct tagMQTMC2 { my ($StrucId, # MQCHAR4 StrucId; /* Structure identifier */ $Version, # MQCHAR4 Version; /* Structure version number */ $QName, # MQCHAR48 QName; /* Name of triggered queue */ $ProcessName, # MQCHAR48 ProcessName; /* Name of process object */ $TriggerData, # MQCHAR64 TriggerData; /* Trigger data */ $ApplType, # MQCHAR4 ApplType; /* Application type */ $ApplId, # MQCHAR256 ApplId; /* Application identifier */ $EnvData, # MQCHAR128 EnvData; /* Environment data */ $UserData, # MQCHAR128 UserData; /* User data */ $QMgrName, # MQCHAR48 QMgrName; /* Queue manager name */ ); # }; foreach (@ARGV) { if (/^TMC 2/) { # Ignore all parms but TMC2 itself ($StrucId, $Version, $QName, $ProcessName, $TriggerData, $ApplType, $ApplId, $EnvData, $UserData, $QMgrName,) = unpack("a4 a4 a48 a48 a64 a4 a256 a128 a128 a48", $_); $QName =~ s/\s+$//; # delete trailing spaces $ApplId =~ s/\s+$//; # delete trailing spaces $UserData =~ s/\s+$//; # delete trailing spaces $EnvData =~ s/\s+$//; # delete trailing spaces $QMgrName =~ s/\s+$//; # delete trailing spaces # Drop program name, keep any command line parms my @ApplArray = split(/\s+/, $ApplId); shift @ApplArray; $ApplId = join(" ", @ApplArray); &DumpTriggerMsg if $Testing; my $Exec = "$ApplId $QName $QMgrName $EnvData"; print "$Exec\n" if $Testing; exec($Exec); } else { print "Parm='$_'\n" if $Testing; } } sub DumpTriggerMsg { print "\$0 = '$0\n"; print "StrucId = '$StrucId'\n"; print "Version = '$Version'\n"; print "QName = '$QName'\n"; print "ProcessName = '$ProcessName'\n"; print "TriggerData = '$TriggerData'\n"; print "ApplType = '$ApplType'\n"; print "ApplId = '$ApplId'\n"; print "EnvData = '$EnvData'\n"; print "UserData = '$UserData'\n"; print "QMgrName = '$QMgrName'\n\n"; } -----Original Message----- From: MQSeries List [mailto:[EMAIL PROTECTED] Behalf Of Robert Broderick Sent: Thursday, June 17, 2004 4:20 PM To: [EMAIL PROTECTED] Subject: Triggered sh/ksh Script Anybody have a copy of a sh/ksh script that is triggered and handles the TM2 passed data area???????????????? I want to extract the Triggered Queue name. bobbee _________________________________________________________________ Check out the coupons and bargains on MSN Offers! http://youroffers.msn.com Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at http://www.lsoft.com Archive: http://vm.akh-wien.ac.at/MQSeries.archive Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at http://www.lsoft.com Archive: http://vm.akh-wien.ac.at/MQSeries.archive