Page 1 of 1

fixed file format is broken

Posted: Mon Jun 02, 2014 9:56 am
by prasson_ibm
Hi,

I have a job with source as sequential file (file format is fixed width) and after transformation i need to add one more column to this file at the end but file format need to be same as it is in source,but it seems datastage is adding some sapce somewhere in file.So i am trying to do below testing.

1. Defined column definition as char in source.
for ex :- Col1 char(2)
Col2 Char(10)

In transformer i am doing one to one mapping and passing these columns to target sequential file.

When i checked length of file it is showing 13 charcter,i have no idea how one character is added to the end of every line :oops:

I will appriciate your input.

Posted: Mon Jun 02, 2014 10:37 am
by chulett
What did you specify as the record delimiter?

Posted: Mon Jun 02, 2014 10:50 am
by ArndW
What tool are you using to check the length? UNIX type files will have a <LF> and Windows format files will have <CR><LF> at the end of each line unless explicitly turned off in sequential file stage definition.

Posted: Mon Jun 02, 2014 10:52 am
by chulett
Exactly. A proper "fixed-width file" has no need of a record delimiter, hence my question as it should be set to "None".

Posted: Mon Jun 02, 2014 11:20 am
by prasson_ibm
Hi,
I have not defined anything in record delimiterr and my source file is only having new line.
When file is created on after processing I checked the length of file in unix using command.

Awk '{print length ($0)}' output file name

And its giving 17 but source file is 15

Posted: Mon Jun 02, 2014 1:16 pm
by chulett
You need to use a hex dump (od -h) on that file or open it in a hex editor and let us know where / what those two extra characters are.