Row Delim

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
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Row Delim

Post 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
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

Did you see the syntax for Field function in help.
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post by vinothkumar »

RowDelim will be a Stage variable which will be having some character as value.
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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
swapnilverma
Participant
Posts: 135
Joined: Tue Aug 14, 2007 4:27 am
Location: Mumbai

Post by swapnilverma »

could u pass sample input and output data.
Thanks
Swapnil

"Whenever you find whole world against you just turn around and Lead the world"
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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"
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
swapnilverma
Participant
Posts: 135
Joined: Tue Aug 14, 2007 4:27 am
Location: Mumbai

Post 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 ..
Thanks
Swapnil

"Whenever you find whole world against you just turn around and Lead the world"
raji33
Premium Member
Premium Member
Posts: 151
Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ

Post 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
Post Reply