Reading null & fixed width integers

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
Akhobare
Participant
Posts: 17
Joined: Mon Aug 17, 2009 8:24 am
Location: Pune

Reading null & fixed width integers

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

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

"You can never have too many knives" -- Logan Nine Fingers
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

Set this Property on Format Tab of the Sequential File Stage.

Code: Select all

Null field value=''
Regards
LakNar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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="          "
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Akhobare
Participant
Posts: 17
Joined: Mon Aug 17, 2009 8:24 am
Location: Pune

Post 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.
Regards,
Akshay
Post Reply