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 » WebSphere Message Broker (ACE) Support » ESQL issue

Post new topic  Reply to topic
 ESQL issue « View previous topic :: View next topic » 
Author Message
2d0
PostPosted: Thu Mar 08, 2007 7:19 am    Post subject: ESQL issue Reply with quote

Apprentice

Joined: 08 Mar 2007
Posts: 25

Hi people,

Currently I'm working on a flow with an input and output MRM messageset.
The inputmessage set has to be mapped to the outputmessage set.

Within the inputmessage set, there is a field called order.
This field is 12 characters long.
If this field contains a letter or more letters, I have map it directly and don't have to do anything.
If it doesn't contain a letter, so only numbers, it has to right justified.

How can I look thru this field till I find the letter?

Thanks in advance.
Kind regards,

Todo.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 08, 2007 7:25 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Model it as characters.

Use SUBSTRING, POSITION, or other String manipulation functions on the value.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
2d0
PostPosted: Thu Mar 08, 2007 7:38 am    Post subject: Reply with quote

Apprentice

Joined: 08 Mar 2007
Posts: 25

Thanks, but I have to find a position of any letter within the string.

Can I use POSITION([a-z]) ?
Which says all letters from a to z.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Mar 08, 2007 7:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

What version? I'm 99% certain 2.1 won't allow a regex expression.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
2d0
PostPosted: Thu Mar 08, 2007 8:03 am    Post subject: Reply with quote

Apprentice

Joined: 08 Mar 2007
Posts: 25

We are using 5.0.4 here.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Mar 08, 2007 8:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Ok, 75% certain that doesn't either but no direct experience (leapfroged 2.1->6.0).

Some kind person will be along in a moment with a definative answer. Or the ESQL manual may have something to say on the subject of regular expressions....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
RocknRambo
PostPosted: Thu Mar 08, 2007 10:43 am    Post subject: Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

If I understand correctly, your looking to determine a field is aplha or alphanumeric or numeric ?

I dont think there is direct function or statement in esql which you cud use, as Jeff mentioned you got use position and substring (string manupulation fun's).

you got loop through the field and check whether each char is numeric.

one of the approach cud be - use while and IF,


-RR
Back to top
View user's profile Send private message
2d0
PostPosted: Thu Mar 08, 2007 11:12 am    Post subject: Reply with quote

Apprentice

Joined: 08 Mar 2007
Posts: 25

Yes you are correct Rambo.

But how do I check on numeric?
POSITION(Numeric in ...) ?
Or do i have to enter all the numbers?
Back to top
View user's profile Send private message
2d0
PostPosted: Fri Mar 09, 2007 3:23 am    Post subject: Reply with quote

Apprentice

Joined: 08 Mar 2007
Posts: 25

Well with a little help I have come to the following structure.
Only the IF doesn't work properly.
It doesn't seem to use the OR.
Anyone an idea?

WHILE (i_order_number < i_order_line) DO
DECLARE i_order_pos CHAR SUBSTRING(InputBody.N2_WMS_IF_ADJUST.N2_WMS_AUFNR FROM i_order_number FOR 1);

IF ((i_order_pos <> '0') OR (i_order_pos <> '1') OR (i_order_pos <> '2') OR (i_order_pos <> '3') OR (i_order_pos <> '4') OR (i_order_pos <> '5') OR (i_order_pos <> '6') OR (i_order_pos <> '7') OR (i_order_pos <> '8') OR (i_order_pos <> '9')) THEN
SET OUTREF.ns4:"sap_wmmbid02_e2mbxyi".ns5:"sap_wmmbid02_e2mbxyi".ns5:"Order_number" = InputBody.N2_WMS_IF_ADJUST.N2_WMS_AUFNR;
SET i_order_number = i_order_line;
END IF;
SET i_order_number = i_order_number + 1;
END WHILE;
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Mar 09, 2007 3:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

2d0 wrote:
Yes you are correct Rambo.

But how do I check on numeric?
POSITION(Numeric in ...) ?
Or do i have to enter all the numbers?


Have you tried creating a java procedure for that purpose?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
2d0
PostPosted: Fri Mar 09, 2007 4:54 am    Post subject: Reply with quote

Apprentice

Joined: 08 Mar 2007
Posts: 25

People,

Thanks for all the help.
I was able to solve it using several AND statements.
I can post the code if anyone is interested.

Cheers,

Todo.
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 » WebSphere Message Broker (ACE) Support » ESQL issue
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.