Page 1 of 1

Reading null & fixed width integers

Posted: Mon Jul 12, 2010 6:05 am
by Akhobare
Hi ,

I am reading fixed-width file having integers. I have 2 requirements where,

i> I need to read null value in Integer field
ii> Should be able to read small integers in 8 digit format e.g. should be able to read '10' also in 8 width format.

I have tried all permutation & combinations except the one that works.
Pardon me if its very simple question, but anyhow i am unable to read integers.

Can anyone plz help with combination of integer meta-data property values?

Early response most welcome.

Posted: Mon Jul 12, 2010 6:34 am
by chulett
Proper forum most welcome as well.

i> What does a "null" integer value in your fixed-width file look like? Make the "null value" property for the field match.

ii> I have no idea what that means. Are you saying that in a fixed-width file you are getting only two characters in an eight character field? :?

ps. Flat files only carry character fields. The stage may be able to do an implicit conversion to other data types but bottom line is all they carry are strings. Depending on several factors, it may be best if you read it as such and handle the explicit conversion yourself.

Posted: Mon Jul 12, 2010 10:25 am
by laknar
Set this Property on Format Tab of the Sequential File Stage.

Code: Select all

Null field value=''

Posted: Mon Jul 12, 2010 4:08 pm
by ray.wurlod
laknar wrote:Set this Property on Format Tab of the Sequential File Stage.

Code: Select all

Null field value=''
Not in a fixed-width field, where the Null Field Value property must have the correct number of characters.

Code: Select all

Null Field Value="          "

Posted: Tue Jul 13, 2010 12:37 am
by Akhobare
Integers metadata properties Default=0 and Field Width=8 solved the problem.

Very simple but somehow i could'nt read it earlier.

Marking topic as Resolved.