max length between two value marks in a multi value column

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kamesh
Participant
Posts: 72
Joined: Tue May 27, 2003 1:47 am

max length between two value marks in a multi value column

Post by kamesh »

RT_LOGxxx has a multi value column MSG.TEXT with output depth of 60T.

What would be the maximum length between two value marks? This is required to determine FMT format value to get the text in one line without any breaks.

Below statement works as expected when number of characters before the first value mark are less than 100 but fails when it exceeds. So I would like to know what value we can use for FMT so that irrespective of length all the TEXT is displayed in one line?

SELECT EVAL "FIELD(MSG.TEXT,CHAR(253),1)" AS EVENT FMT '100L' FROM RT_LOGxxx
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are no limits. The original UniVerse database storage concept allowed for completely arbitrary stucture sizes (limited only by machine resources).

Some log messages, particularly those returned from Microsoft ODBC data sources, are thousands of characters long.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kamesh
Participant
Posts: 72
Joined: Tue May 27, 2003 1:47 am

Post by kamesh »

Thank you Ray!
I am not a premium member but planning to be one very soon. Would you mind suggesting the alternative for my requirement so that below sql works without any line breaks for each row it returns irrespective of log message length.

SELECT EVAL "FIELD(MSG.TEXT,CHAR(253),1)" AS EVENT FMT '100L' FROM RT_LOGxxx

Please help me out! I really appreciate it!
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Your are using "FMT '100L'" in your command, so if you have more than 100 characters the SELECT inserts a line break. It is easiest to filter those out yourself from UNIX or elsewhere.
kamesh
Participant
Posts: 72
Joined: Tue May 27, 2003 1:47 am

Post by kamesh »

Thank you ArndW!

I can easily filter it but I still need the complete message text as one line input to my looping logic in the UNIX script.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Your SELECT output is comin into your script on stdin, right? So just filter it with "tr -d '\n' " and you've achieved your goal.
kamesh
Participant
Posts: 72
Joined: Tue May 27, 2003 1:47 am

Post by kamesh »

That is true ArndW but that would also remove line breaks between each output row as well which I need to keep.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Change your query to

Code: Select all

SELECT EVAL "'*':FIELD(MSG.TEXT,CHAR(253),1)" AS EVENT FMT '100L' FROM RT_LOGxxx 
Then convert the '*' character back into a <Lf> after removing all linefeeds; use some other character if the '*' appears in your text.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no general solution, because there is an upper limit on the device width but there is no upper limit on the size of MSG.TEXT.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kamesh
Participant
Posts: 72
Joined: Tue May 27, 2003 1:47 am

Post by kamesh »

Thank You Arnd & Ray!!!
I will work on Arnd suggestion to get what I required.
Post Reply