Page 1 of 1

Row Delim

Posted: Tue Oct 26, 2010 7:04 am
by raji33
Hi All,

Can any one help in understanding this code

Trim(Field(Merge_Out.CRC_ROW,RowDelim,1,4),' ','B')

Thanks in advance

Posted: Tue Oct 26, 2010 7:28 am
by vinothkumar
Did you see the syntax for Field function in help.

Posted: Tue Oct 26, 2010 7:51 am
by raji33
Hi VinothKumar,

Thank you for quick responce, but delimiter is the character(ex:#,?,&,/) but here it is" RowDelim" that means is it delimiting string with substring RowDelim for the occurences 1 and 4? and then triming the leading and trailing spaces ?

Thanks

Posted: Tue Oct 26, 2010 7:57 am
by vinothkumar
RowDelim will be a Stage variable which will be having some character as value.

Posted: Tue Oct 26, 2010 8:09 am
by raji33
vinoth i dont see any stage variable here , Actually it is a deliverd job from peoplesoft iam analysing that job so encountered this code

Posted: Tue Oct 26, 2010 9:03 am
by swapnilverma
could u pass sample input and output data.

Posted: Tue Oct 26, 2010 9:30 am
by raji33
Hi swapnil,

This is not which we designed its a delivered job from people soft and iam analysing the job the design is like this.

RDBMS
|
|
\/
interprocess
| | |
\/
rowmerge------>transformer-->transformer---->rowsplit-->transformer
|
interprocess
|
|
\/
RDBMS
and 2 hash files refernce and update to second transformer


and i see this code in first transformer

Posted: Tue Oct 26, 2010 9:32 am
by ArndW
This code takes fields 1-4 of string Merge_Out.CRC_ROW as delimited by value of the character in RowDelim and then trims all blanks from the beginning and end of the string.

for example, if RowDelim is the semicolon character ";" then
if

Code: Select all

Merge_Out.CRC_ROW = "       Hello;there;Fellow;DSXchangers       ;in;    the;internet"
Then the result would be "Hello;there;Fellow;DSXchangers"

Posted: Tue Oct 26, 2010 9:44 am
by raji33
Hi ArndW,

Thank you very much , but iam anable to see the example as iam not a primium poster can you please type the example

Posted: Tue Oct 26, 2010 9:51 am
by ArndW
There is a reason for premium memberships to DSXChange and in this case there would seem to be two possible choices, either I could post the answer again as a non-premium message or you could change to premium membership. I am sure you can understand why choice 2 is the better route.

Of course another alternative would be if someone else would post an example.

Posted: Tue Oct 26, 2010 1:04 pm
by swapnilverma
Hi Raji,

Please verify RowDelim should be defined some where.

As there is no keyword in DS as "RowDelim"...

Trim(Field(Merge_Out.CRC_ROW,RowDelim,1,4),' ','B')


As per Field function definition ... it will treat value of RowDelim as delimiter and will return data between 3rd and forth occurrence of Delimiter.

Its a Difficult situation when u do not have sample input data ..

Posted: Tue Oct 26, 2010 2:04 pm
by raji33
Hi swapnil,

Actually entire input fields are being merged into a single row so that the entire row can be sent as a single argument to the CRC32() routine. Trim(Field(Merge_Out.CRC_ROW,RowDelim,1,4),' ','B') is derivation which is being applied on single row.

Thanks
Raji