Hi All,
I am trying to create a fixed width file, where all the incoming fields have datatype char and Nullable.
I haven't mentioned any format properties, except Null field value as '', in sequential file stage. The problem now is, a space is getting added after each field, in the output file. How I can remove that?
I tried to give the format as Fixed width, but I got an error saying 'Error when checking operator: "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is 'Field_name'.
Can someone please help?
Thanks
Creating fixed width file
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 60
- Joined: Thu Dec 17, 2009 1:36 am
First off, you cannot have any nullable fields in a fixed-width file unless you also make sure the Null Field Value is all spaces. Also, I seem to recall a property where you specify the number of bytes between columns, you may need to set that to zero. Also think you need to make sure you set the Display Size (?) properly as that value is what it uses to determine the fixed-width size - I'm assuming it isn't set and is why you are seeing the 'no length given' message.
But it has been a while.
Oh, also make sure your APT_STRING_PADCHAR variable is set to 0x20.
But it has been a while.
Oh, also make sure your APT_STRING_PADCHAR variable is set to 0x20.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 60
- Joined: Thu Dec 17, 2009 1:36 am
Thanks Craig.
Mine is not a fixed length file. But its a fixed width column file. If any value is null, then nothing should be populated.
Your comments made me check the APT_STRING_PADCHAR variable and I have changed it to 0x0 at job level (it was 0x20). Now the output file is getting populated correctly.
Mine is not a fixed length file. But its a fixed width column file. If any value is null, then nothing should be populated.
Your comments made me check the APT_STRING_PADCHAR variable and I have changed it to 0x0 at job level (it was 0x20). Now the output file is getting populated correctly.
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Honestly never heard of such a thing. A column can't be any kind of "fixed" in width if the width changes when the value is null.gayathrisivakumar wrote:Mine is not a fixed length file. But its a fixed width column file. If any value is null, then nothing should be populated.
But if it is working as you need it to work, then yay.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers