Warning "cannot convert null....

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Warning "cannot convert null....

Post by cosec »

How Can I not have a warning incase a null value is being loaded from a fixed with sequential file to a db2 table ?

how can I get datastage to treat spaces as null ?

AdjBar..Transformer_6: At row 1, link "Output", while processing column "VERSION_NO"
Value treated as NULL
Attempt to convert String value " " to Long type unsuccessful
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They are two different things. If you want spaces to be NULL in your target, explicitly convert them in your job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Post by cosec »

Done...but I thought there would be an easier way to handle it.....but what about the warning ? can i make it not specify it as a warning
chulett wrote:They are two different things. If you want spaces to be NULL in your target, explicitly convert them in your job. ...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you specify " " as the representation of NULL in this field, in the Columns grid, then " " will automatically be read as NULL, which IS valid as a Long, so the warning will disappear!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Post by cosec »

I do the following to handle it
if trim(Arg1) ="" then @null else trim(Arg1)

Are you saying I have no other alternative but to validate every column ???
ray.wurlod wrote:If you specify " " as the representation of NULL in this field, in the Columns grid, then " " will automatically be read as NULL, which IS valid as a Long, so the warning will disappear! ...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, read the reply again and check the help for the 'Null String' column option in the Sequential File stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can set the default for all columns on the Format tab. However, the default of "" is probably better in most cases; where you want " " (that is, a space) to be the representation of NULL, I recommend doing this explicitly at the column level.

Incidentally, Trim(" ") returns " ", never "". You would need Convert() to eliminate all space characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply