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 » Convert lowercase words to Uppercase in middle of the String

Post new topic  Reply to topic Goto page 1, 2  Next
 Convert lowercase words to Uppercase in middle of the String « View previous topic :: View next topic » 
Author Message
RAJASHEKAR REDDY
PostPosted: Thu Aug 15, 2013 11:13 pm    Post subject: Convert lowercase words to Uppercase in middle of the String Reply with quote

Novice

Joined: 09 May 2013
Posts: 13

Hi Folks,

i have an example string like

NAME=Raja&UserId=shekar&PSWD=1111&Village=abbd&DIST=pqrs&STATE=dfhfh&sex=male

So i want convet Lowercase Parametrs(UserId,Village,sex) to UPPER CASE with in ESQL.

Could you please suggest on this.



Thanks,
RajaShekar Reddy
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Aug 16, 2013 12:21 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Why do you need to do this?
Are you using a parser ( MRM or DFDL ) to create a message tree from the string?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
RAJASHEKAR REDDY
PostPosted: Fri Aug 16, 2013 12:41 am    Post subject: Reply with quote

Novice

Joined: 09 May 2013
Posts: 13

No, i need to caluclate SHA, i want Upper case Parameters
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Aug 16, 2013 1:25 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

How are you extracting the data fields from the formatted string?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
RAJASHEKAR REDDY
PostPosted: Fri Aug 16, 2013 2:02 am    Post subject: Reply with quote

Novice

Joined: 09 May 2013
Posts: 13

it's comming as string in single line from external system as above mentioned string. so i need to change parametters as UPPER case.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Aug 16, 2013 2:55 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
it's comming as string in single line from external system as above mentioned string. so i need to change parametters as UPPER case.
Yes, I know. You told us that before.

But how are you extracting the data fields from the formatted string?
Using customer ESQL? Or using a message set?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
dogorsy
PostPosted: Fri Aug 16, 2013 3:07 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

Write an ESQL function to which you pass as parameters the input string and the parameter you want converted to uppercase + the = sign,for example : UserId= or Village=
use index to find the start of the keyword in the string, then add the length of the keyword to calculate the start of the word you want to uppercase. Then look for the & sign or end of string to calculate the end of the word.
once you have start and end of the word, use uppercase.

You can then call the function once for each keyword. If you want to do it all in one go, instead of passing a single parameter, you can build a row in the Environment tree containing all the keywords , and pass a REFERENCE to the function. If you know the keywords are always in the same order, you can build your tree in that order, and the search of the next keyword in the string can start where you finished with the previous one ( supposing you found one ). But it is up to you to work out the logic.


Last edited by dogorsy on Fri Aug 16, 2013 3:15 am; edited 1 time in total
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Aug 16, 2013 3:12 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

While it is possible to do this in ESQL as kimbert and dogorsy have mentioned, this might be a use case where a JCN is more appropriate. Hopefully, your manager has not told you that you are prohibited from using Java Compute Nodes (JCNs)...
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
RAJASHEKAR REDDY
PostPosted: Fri Aug 16, 2013 3:18 am    Post subject: Reply with quote

Novice

Joined: 09 May 2013
Posts: 13

Thanks to all,

i need write in ESQL and i have many Parameters.


And no need to extacting , i want send as same string but parametters should be UPPER CASE

Thanks
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Aug 16, 2013 4:11 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Out of interest is this string arriving as a "query-string" from an HTTPInput node?
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
NealM
PostPosted: Fri Aug 16, 2013 4:58 am    Post subject: Reply with quote

Master

Joined: 22 Feb 2011
Posts: 230
Location: NC or Utah (depends)

Use a FOR loop, inside it use POSITION to find your first '&', use another POSITION to find your first '=' after your &, apply UPPER to the chars between them, then move past that before repeating your loop. End the loop when POSITION returns a zero.
Play with it, it won't take you long to get it working.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Aug 16, 2013 5:59 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

mgk wrote:
Out of interest is this string arriving as a "query-string" from an HTTPInput node?


That is an interesting thought.
In these cases I use a common procedure to extract each param in the request. It is not difficult to extract each bit.

You could even do it in a loop where the extract returns the next param and loops until nothing is returned. Then you can use a CASE structure to selectively convert those required to UPPERCASE.

Not that difficult if you put your mind to it.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Aug 16, 2013 6:32 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
That is an interesting thought.


My thought was that if it was a query-string then there is an option on the HTTPInput node which it will split the string into name-value pairs and place them in the LocalEnvironment for you, so no coding required at all

Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Aug 16, 2013 6:33 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

mgk wrote:
Quote:
That is an interesting thought.


My thought was that if it was a query-string then there is an option on the HTTPInput node which it will split the string into name-value pairs and place them in the LocalEnvironment for you, so no coding required at all ,



Oooo - aaaaah ! A new feature !
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Fri Aug 16, 2013 6:40 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
Oooo - aaaaah ! A new feature !


Well, it was new once, back in 6.1.0.4, when "the Parse Query String" option was introduced


Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Convert lowercase words to Uppercase in middle of the String
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.