Page 1 of 1

split one record to multiple records and field delemeter &qu

Posted: Sun Jul 13, 2008 7:11 am
by vinodn
Hi,

My input record is given below

"name","desig","description"=======Column names

"raghunath","software","software,engineerfromindia" ===== Data

My Requirement is given below,

1) need to check the delemeters(",") count , if it is fine then process the record, otherwise abort the job and send mail to source system

Here comma is coming within the data so delemeter is coming as ","

i am unable to find the count by using the count function in datastage for the delemeter(",")

2)need to split the above record into 3 records and write the records into one output file

output as

raghunath
software
software,engineerfromindia




and one more thing is i need to check the description column, if the lenth is greaterthan 3, need split the description column(max 3 charecters)

output as

raghunath
software
sof
twa
re,
eng
ine
erf
rom
ind
ia


Can you please give the suggestion,

Regards
Ramesh

Posted: Sun Jul 13, 2008 7:25 am
by ArndW
The first problem isn't too tough, you need to apply the rule as

the first and last characters must be double-quotes and the internal delimiters must be '","'. This can be done with simple left(), right(), and count functions in your transform logic.

Once you have that solved, you can look up "pivot"

split one record to multiple records and field delemeter &qu

Posted: Sun Jul 13, 2008 9:28 am
by vinodn
Thanks for your's suggestion,

Pivot is not the solution, because i need to write the records into the target output file

Job reads the first record from the file and first 3 columns write into the ouput file as first record and next 3 columns write into the same target file as second record and so on,

Next job reads second record from the source file and process the same as above

Is it work char(10) in transformer satge for new line

split one record to multiple records and field delemeter &qu

Posted: Sun Jul 13, 2008 9:29 am
by vinodn
Thanks for your's suggestion,

Pivot is not the solution, because i need to write the records into the target output file

Job reads the first record from the file and first 3 columns write into the ouput file as first record and next 3 columns write into the same target file as second record and so on,

Next job reads second record from the source file and process the same as above

Is it work char(10) in transformer satge for new line

Re: split one record to multiple records and field delemeter

Posted: Sun Jul 13, 2008 9:38 am
by chulett
vinodn wrote:Pivot is not the solution, because i need to write the records into the target output file
Not sure what the relevance is here, one to the other. :?
vinodn also wrote:Job reads the first record from the file and first 3 columns write into the output file as first record and next 3 columns write into the same target file as second record and so on
In other words, a pivot of columns to rows. Perhaps a little Abby Normal but a pivot nonetheless.