Page 1 of 1
Variable field manipulation
Posted: Fri Aug 19, 2011 5:15 am
by js_j
Hi,
The following is my field structure:
201106;4000;160,50;12345678
200106;4008;6,50;12345679 etc..
I have to load these into a Dataset. I have used a transformer for extracting the field info like Input.Fileinput[1,6] like wise and loaded the first two columns in the Dataset. but for the third column i am not knowing how to extract the data as they are of variable length. The data in the third column should be treated as decimal with scale of 2 digits.
It is a parallel job and let me know how to load the remaining columns.
I am new to this forum and this is my first post.
thanks,
JJ
Posted: Fri Aug 19, 2011 5:30 am
by arvind_ds
Your Job Design should be like this.
Seq File --> Transformer --> DataSet
Use semicolon as a Delimeter in Seq File stage properties.
HTH
Posted: Fri Aug 19, 2011 5:38 am
by js_j
arvind_ds wrote:Your Job Design should be like this.
Seq File --> Transformer --> DataSet
Use semicolon as a Delimeter in Seq File stage properties.
HTH
Hi,
used the same. works for the first two columns but not for the third one.
Posted: Fri Aug 19, 2011 5:41 am
by arvind_ds
What is the data type for third column.
Change it to varchar, everything written in a sequential file is of type string.
Posted: Fri Aug 19, 2011 5:45 am
by js_j
arvind_ds wrote:What is the data type for third column.
Change it to varchar, everything written in a sequential file is of type string.
I have tried to use the input file as one string such as Fileinput/varchar/64000 with no nullability. I am using the column as varchar only.
Posted: Fri Aug 19, 2011 5:50 am
by arvind_ds
Define 4 columns in the column definition of seq file stage with type varchar, put some number in lenght field and nullability no.
Set delimeter to semicolon.
I tested one job at my end with below data in seq file and it worked fine.
201106;4000;160,50;12345678
200106;4008;6,50;12345679
Are you able to view data from sequential file stage?
Posted: Fri Aug 19, 2011 5:58 am
by js_j
arvind_ds wrote:Define 4 columns in the column definition of seq file stage with type varchar, put some number in lenght field and nullability no.
Set delimeter to semicolon.
I tested one job at my end with below data in seq file and it worked fine.
201106;4000;160,50;12345678
200106;4008;6,50;12345679
Are you able to view data from sequential file stage?
Hi,
This works
Just for Information why i cant the get when i am trying to see the whole file as a single string and then separate the same?
if possible let me know.
thanks once again.
JJ
Posted: Fri Aug 19, 2011 5:59 am
by arvind_ds
Rome was not built in a day
Posted: Fri Aug 19, 2011 6:05 am
by js_j
arvind_ds wrote:Rome was not built in a day
Cool...
:D
Posted: Fri Aug 19, 2011 4:37 pm
by ray.wurlod
Specify None as the record terminator.