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 » Masking possible in ESQL ?

Post new topic  Reply to topic
 Masking possible in ESQL ? « View previous topic :: View next topic » 
Author Message
5zan
PostPosted: Mon Jul 21, 2008 7:22 am    Post subject: Masking possible in ESQL ? Reply with quote

Novice

Joined: 08 Jul 2008
Posts: 24

i have to mask a number with 5 zero's .

i.e if my number is a 2 digit number , i have to preceed that with 3 zeros ..

for example if 23 is the input , my output should be 00023

if the number is a 3 digit number , for example 123 my output should be 00123

and so on ... is there a function in ESQL which does this ?

Can this be done without any loops ?
Back to top
View user's profile Send private message
sridhsri
PostPosted: Mon Jul 21, 2008 7:29 am    Post subject: Reply with quote

Master

Joined: 19 Jun 2008
Posts: 297

Normally, such a thing should be done in the MRM - using a padding character.

Having said that, you could initialize a string with '00000' and convert your integer to another string '123' then using the overlay esql method to give you '00123'. But I would prefer modeling this in MRM as a padding char.
Back to top
View user's profile Send private message
5zan
PostPosted: Mon Jul 21, 2008 7:49 am    Post subject: Reply with quote

Novice

Joined: 08 Jul 2008
Posts: 24

yes sridhsri , but here its a simple ESQL that i need .

I just need a function which can do that or any logic ~
Back to top
View user's profile Send private message
broker_new
PostPosted: Mon Jul 21, 2008 12:49 pm    Post subject: Reply with quote

Yatiri

Joined: 30 Nov 2006
Posts: 614
Location: Washington DC

You can do that using a simple ESQL statement using pattern statement;
Go to info center and search for cast pattern
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp

you will find lot of examples regarding that
Back to top
View user's profile Send private message
broker_new
PostPosted: Mon Jul 21, 2008 12:52 pm    Post subject: Reply with quote

Yatiri

Joined: 30 Nov 2006
Posts: 614
Location: Washington DC

The ESQL is as follows

DECLARE source INTEGER 123;
DECLARE target CHARACTER;
DECLARE pattern CHARACTER '00000';
SET target = CAST(source AS CHARACTER FORMAT pattern);
Back to top
View user's profile Send private message
5zan
PostPosted: Tue Jul 22, 2008 12:14 am    Post subject: Reply with quote

Novice

Joined: 08 Jul 2008
Posts: 24

thanx broker_new , dat was it !

thanx sridhsri !
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 » Masking possible in ESQL ?
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.