View previous topic :: View next topic
|
Author |
Message |
Prasanth Kumar
New User
Joined: 22 Apr 2011 Posts: 3 Location: India
|
|
|
|
Hi,
I need help for the below requirement. Tried searching the forum, could not find answer, so posting it here.
My COBOL cics program reads data from an MQ and based on reference number present on the MQ it needs to route the message to one of the 5 output MQ's. The src-ref-no (reference number) is X(20) and it can contain numeric as well as alphanumeric and special characters like '-' etc;
I need to define the range on this src-ref-no to distribute the incoming traffic to the 5 different output mq's.
Example:
src-ref-no : abc1150235454, gps345404505, 110030040500 etc;
Each time the the program gets the same src-ref-no again and again it should route the message to the same output MQ as it was sent earlier. Something like :
if src-ref-no > range-1
go to mq-1
else if src-ref-no > range-2
go to mq-2.
.......till range-5.
how to define the range on alphanumeric items ? I can have the range hardcoded in the program or read from a db2 table.
I can rip off the special chars and apply a uniform range on the alphanumeric field too.
Please help. |
|
Back to top |
|
|
Prasanth Kumar
New User
Joined: 22 Apr 2011 Posts: 3 Location: India
|
|
|
|
More information:
Example:
src-ref-no : abc1150235454, gps345404505,
110030040500, abd23244545-51, aod234545-31 |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
You don't need to define a range. All you need is a logic to identify a record(src-ref-no) to send to a particular output queue.
The logic could be anything such as: If the ref no ends with 0,5 then send to Q1, if ends with 1,6 then send to Q2, .... etc.
Similar logic can be applied for alphabets. If the first alphabet of ref no is A, F, K, P, U, Z then send to Q1, .... etc.
I don't see anything to do with COBOL or MQ here. You only needed the logic.
. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
You need to clear about the term Range. For me it seems the requirements are not cleared.
If you get abc1150235454 then what would you like to do? What range you want?
As you said, you can predefine the ranges in DB2 and then select the Queue name based on input src-ref-no value. |
|
Back to top |
|
|
|