Column Import For Fixed Width File

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
senthilt1
Participant
Posts: 134
Joined: Mon Nov 19, 2007 2:17 am

Column Import For Fixed Width File

Post by senthilt1 »

Hi All,

I have to split up my input record in to 4 columns.

My Input Seq file has a single column.

Input data is:

1234abcd9089qwer
0989mnop0909sdfg

My O/p file needs four columns, Expected o/p data is:

col1 -1234
col2 -abcd
col3 -9089
col4 -qwer

How shall i achieve this through the column import stage for the fixedwidth record.

Thanks,
SenthilP
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Declare the 4 output fixed columns and make the file format with fixed width & no column separators.
senthilt1
Participant
Posts: 134
Joined: Mon Nov 19, 2007 2:17 am

Post by senthilt1 »

HI ArndW,

Thanks for your reply,

I tried it, The columns are splitted but the values are not proper.

for my given input: 1234qwer0989lkjh

The output column values are:

col1-1234
col2-0989
col3-
col4-

There is no value for col3 and col4. also col2 value is wrong.
Why the output is coming like this, i have all my output datatype as Varchar. For my single input field also i have given as varchar.

Please help me,

Thanks,

Senthil P
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

If it's fixed width surely your field types need to be char??
senthilt1
Participant
Posts: 134
Joined: Mon Nov 19, 2007 2:17 am

Post by senthilt1 »

Hi,

I tried giving char to my field types, even then i dint get the output.

In col Import stage, i set Record length is Fixed and no field defaults.

For My input seq file, I set the Record length as fixed.

If i change my datatypes to char, it says that" White space Delimiter is missing at offset 4". But i never set any delimiter anywhere.

Please help to resolve this issue,

Thanks,
Senthil P
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Using "Char" was a necessary first step. It looks like you have specified delimiters in the column import file definitions, though.
senthilt1
Participant
Posts: 134
Joined: Mon Nov 19, 2007 2:17 am

Post by senthilt1 »

I havent specified the delimiter anywhere, but when i use the char as my datatype for both the Input and output columns of Column import i am getting this error. "Field "col1" lacks whitespace delimiter, at offset: 4 "

Will Column Import surely work for fixed with file?

Please let me know,

Thanks,

senthil P
Post Reply