Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To determine the range on a Alphanumeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Prasanth Kumar

New User


Joined: 22 Apr 2011
Posts: 2
Location: India

PostPosted: Mon Feb 15, 2016 9:35 am    Post subject: To determine the range on a Alphanumeric field
Reply with quote

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
View user's profile Send private message

Prasanth Kumar

New User


Joined: 22 Apr 2011
Posts: 2
Location: India

PostPosted: Mon Feb 15, 2016 9:37 am    Post subject:
Reply with quote

More information:
Example:
src-ref-no : abc1150235454, gps345404505,
110030040500, abd23244545-51, aod234545-31
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Mon Feb 15, 2016 11:54 am    Post subject: Reply to: To determine the range on a Alphanumeric field
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Tue Feb 16, 2016 9:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 22 Tue Dec 06, 2016 8:04 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us