Variable field manipulation

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
js_j
Participant
Posts: 12
Joined: Fri Aug 19, 2011 5:04 am
Location: India

Variable field manipulation

Post 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
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Post 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 8)
Arvind
js_j
Participant
Posts: 12
Joined: Fri Aug 19, 2011 5:04 am
Location: India

Post 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 8)
Hi,
used the same. works for the first two columns but not for the third one.
:(
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Post 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.
Arvind
js_j
Participant
Posts: 12
Joined: Fri Aug 19, 2011 5:04 am
Location: India

Post 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.
:)
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Post 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?
Arvind
js_j
Participant
Posts: 12
Joined: Fri Aug 19, 2011 5:04 am
Location: India

Post 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
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Post by arvind_ds »

Rome was not built in a day
Arvind
js_j
Participant
Posts: 12
Joined: Fri Aug 19, 2011 5:04 am
Location: India

Post by js_j »

arvind_ds wrote:Rome was not built in a day
Cool...
:D
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Specify None as the record terminator.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply