Page 1 of 1

getting topic tag in uppercase

Posted: Wed Jul 19, 2006 4:39 am
by sateeshbabu
Hi Friends,

If i use this if NOT(isNull(Ln_Mfs_Exp_msg.MsgTopic)) Then UpCase(Ereplace(Ln_Mfs_Exp_msg.MsgTopic,' ',"")) Else ""

I am getting th topic tag as MFS/EXPENSEACCRUAL/ADJUSTMENT.

I have to process the XML message even when the content of the Topic tag is either upper case or lower case.

If i give the topic tag as MFS/EXPENSEACCRUAL/adjustment.I should get like MFS/EXPENSEACCRUAL/ADJUSTMENT.

Please suggest me to modify.

Thanks in advance.

sateesh.M

Posted: Wed Jul 19, 2006 6:30 am
by chulett
Confusing. What exactly is your problem? You seem to be saying that you get what you want to get. :?

UpCase will work just fine and convert a string to all upper case, so that shouldn't be an issue.

getting topic tag in uppercase

Posted: Wed Jul 19, 2006 7:26 am
by sateeshbabu
Hi Craig,
Thanks for your reply.I am posting it clearly now.

As of now we are inserting messages with the topic tag name as <Topic>MFS/EXPENSEACCRUAL/ADJUSTMENT</Topic>.But even if the incoming xml with topic tag as<Topic>MFS/EXPENSEACCRUAL/adjustment</Topic> I should get it as <Topic>MFS/EXPENSEACCRUAL/ADJUSTMENT</Topic>.So far i defined the stage variable derivation: if NOT(isNull(Ln_Mfs_Exp_msg.MsgTopic)) Then UpCase(Ereplace(Ln_Mfs_Exp_msg.MsgTopic,' ',"")) Else ""

It is working fine if the incoming xml message with topic tag name <Topic>MFS/EXPENSEACCRUAL/ADJUSTMENT</Topic>. But I need to get if the topic is mixed with lowercase also i should get it in uppercase only.

Please through some light to solve this.

Thanks in advance.

Sateesh.M

Posted: Wed Jul 19, 2006 7:58 am
by chulett
:? Still don't see any burning reason why UpCase wouldn't be working for you. And you still haven't said what happens when it doesn't "work fine". Posting an example of what comes out that you don't like would help tremendously.

Why not just simplify things and get rid of all that extra stuff? No need to avoid nulls and you don't seem to need the EReplace. Try just:

Code: Select all

UpCase(Ln_Mfs_Exp_msg.MsgTopic)
and see what happens.

getting topic tag in uppercase

Posted: Wed Jul 19, 2006 11:33 pm
by sateeshbabu
Hi Craig,


It doesn't work fine means.

When we are parsing xml message

INPUT:

" <?xml version="1.0" ?>

<MfsEnv>

<Mfsh>

<Psc>

<Command>Publish</Command>

<Topic>MFS/EXPENSEACCRUAL/adjustment</Topic>

<QName>CUST.EXPENSE.ADJ.REQ.Q</QName>

<QMgrName>WAS_MQ_server1</QMgrName>

i should get

OUTPUT:

" <?xml version="1.0" ?>

<MfsEnv>

<Mfsh>

<Psc>

<Command>Publish</Command>

<Topic>MFS/EXPENSEACCRUAL/ADJUSTMENT</Topic>

<QName>CUST.EXPENSE.ADJ.REQ.Q</QName>

<QMgrName>WAS_MQ_server1</QMgrName>

I tried with your code but still iam facing same thing when i am parsing the Input i am getting <Topic>MFS/EXPENSEACCRUAL/adjustment</Topic> only.

Thanks,
Sateesh.M

Posted: Wed Jul 19, 2006 11:48 pm
by loveojha2
How exactly you are parsing it.

Try something like UpCase(Ln_Mfs_Exp_msg.MsgTopic) : "123"
and see whether you are getting 123 appended or not. I guess the particular derivation is not at all executed. Are you having any condition on the derivation.

getting topic tag in uppercase

Posted: Thu Jul 20, 2006 12:28 am
by sateeshbabu
yes i am writnig a condition that if the message topic is null it should get rejected.

Sateesh.M

Posted: Thu Jul 20, 2006 12:30 am
by loveojha2
Ok don't think that is the hurdle.
Did you tried the derivation that i suggested? Are you getting the suffixed string also.

Posted: Thu Jul 20, 2006 12:46 am
by chulett
This continues to make absolutely no sense to me. Perhaps you should post a clear explanation of your job design, what comes in and what should go out - and what you mean by 'parsing' the XML. :?

Typically, you would read the file into the job using the Folder stage and it would be 'parsed' by an XML Input stage. The XPath expressions there 'flatten' the XML into records you would then write out to a sequential file or insert into a database. However, you seem to mean something else entirely when you say parse. Perhaps you mean reformat?

And converting a string to all upper case is a trivial transformation, so no clue why it isn't happening for you. As suggested, it sounds like its not being called or executed...

Posted: Thu Jul 20, 2006 6:50 am
by sateeshbabu
Hi Craig,

I am not able to put my topic properly infront of you.If i troubled u guys i am sorry.

1.As you said we are reading the file into job using Folder stage and then we are writing into Queue.

2.In the next job we are reading messages from Queue and loading it into Database(Staging Table).

3.Next job:From the staging table i am parsing the messages by using Xmlinput stage.Here based upon the topic tag it will parse the messages into target tables.

Here i am facing the problem.If my incoming xml message with topic Tag as <Topic>MFS/EXPENSEACCRUAL/ADJUSTMENT</Topic>

it is parsing it as <Topic>MFS/EXPENSEACCRUAL/ADJUSTMENT</Topic>.

But eventhough my incoming message topic tag as like this <Topic>mfs/Expenseaccrual/adjustment</Topic>.I need to get as <Topic>MFS/EXPENSEACCRUAL/ADJUSTMENT</Topic>.

In stage variable derivation i am giving as Svartopic as if NOT(isNull(Ln_Mfs_Exp_msg.MsgTopic)) Then UpCase(Ereplace(Ln_Mfs_Exp_msg.MsgTopic,' ',"")) Else "".
And in transformerstage of Target tables i am giving derivation for Topic as trim(Ln_Mfs_Exp_msg.MsgTopic).

I tried using with ur suggestions but i am getting The topic as mfs/Expenseaccrual/adjustment.
Any suggestions would be appreciated.

Posted: Thu Jul 20, 2006 7:06 am
by chulett
Don't worry about it, this site is all about troubling people for help on problems. :wink:

It's just frustrating me that something that should be fairly simple is not getting solved. Obviously either I'm overlooking something or there is a critical piece of information that you don't know is critical and haven't passed along. :?

Oh, and all you people in the home audience - don't let me have all the fun, please - take yer shot. Put me out of my misery.

Posted: Thu Jul 20, 2006 7:49 am
by ray.wurlod
Still struggling with HTML, not ready for "son of" yet.