getting topic tag in uppercase

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

getting topic tag in uppercase

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

getting topic tag in uppercase

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

getting topic tag in uppercase

Post 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
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post 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.
Success consists of getting up just one more time than you fall.
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

getting topic tag in uppercase

Post by sateeshbabu »

yes i am writnig a condition that if the message topic is null it should get rejected.

Sateesh.M
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post 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.
Success consists of getting up just one more time than you fall.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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...
-craig

"You can never have too many knives" -- Logan Nine Fingers
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Still struggling with HTML, not ready for "son of" yet.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply