Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 3
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: 3
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: 447
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: 2267
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 IEFUSI - SMFLIMXX - How to determine ... vasanthz All Other Mainframe Topics 13 Thu Sep 05, 2019 12:05 am
No new posts Select based on a range from a differ... sergeyken SYNCSORT 2 Fri Aug 16, 2019 12:37 am
This topic is locked: you cannot edit posts or make replies. Select based on a range from a differ... vamsimul SYNCSORT 13 Tue Aug 13, 2019 12:36 pm
No new posts RACF RANGE TABLE Martin Wickenden All Other Mainframe Topics 1 Mon Jul 08, 2019 9:06 pm
No new posts SECTION BASED ON FIELD speermb DFSORT/ICETOOL 10 Mon Jun 17, 2019 9:41 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us