fixed file format is broken

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
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

fixed file format is broken

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What did you specify as the record delimiter?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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".
-craig

"You can never have too many knives" -- Logan Nine Fingers
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply