Author |
Message |
js_j
Participant
Joined: 19 Aug 2011
Posts: 12
Location: India
Points: 94
|
|
|
|
|
|
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
|
|
|
|
 |
arvind_ds
Participant
Joined: 16 Aug 2007
Posts: 428
Location: Manali
Points: 4205
|
|
|
|
|
|
Your Job Design should be like this.
Seq File --> Transformer --> DataSet
Use semicolon as a Delimeter in Seq File stage properties.
HTH
|
_________________ Arvind |
|
|
 |
js_j
Participant
Joined: 19 Aug 2011
Posts: 12
Location: India
Points: 94
|
|
|
|
|
|
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.
|
|
|
|
 |
arvind_ds
Participant
Joined: 16 Aug 2007
Posts: 428
Location: Manali
Points: 4205
|
|
|
|
|
|
What is the data type for third column.
Change it to varchar, everything written in a sequential file is of type string.
|
_________________ Arvind |
|
|
 |
js_j
Participant
Joined: 19 Aug 2011
Posts: 12
Location: India
Points: 94
|
|
|
|
|
|
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.
|
|
|
|
 |
arvind_ds
Participant
Joined: 16 Aug 2007
Posts: 428
Location: Manali
Points: 4205
|
|
|
|
|
|
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?
|
_________________ Arvind |
|
|
 |
js_j
Participant
Joined: 19 Aug 2011
Posts: 12
Location: India
Points: 94
|
|
|
|
|
|
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
|
|
|
|
 |
arvind_ds
Participant
Joined: 16 Aug 2007
Posts: 428
Location: Manali
Points: 4205
|
|
|
|
|
|
Rome was not built in a day
|
_________________ Arvind |
|
|
 |
js_j
Participant
Joined: 19 Aug 2011
Posts: 12
Location: India
Points: 94
|
|
|
|
|
|
arvind_ds wrote: |
Rome was not built in a day |
Cool...
|
|
|
|
 |
ray.wurlod
Participant
Group memberships: Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group
Joined: 23 Oct 2002
Posts: 54464
Location: Sydney, Australia
Points: 295356
|
|
|
|
|
|
Specify None as the record terminator.
|
_________________ RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane |
|
|
 |
|