How to check if a column is blank

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
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

How to check if a column is blank

Post by Shree0410 »

Hi guys,

I have a column 'DOC1' which is 10 bytes CHAR.
I have to populate 'A' if this column is blank.
I am using the logic If (IsNull(DOC1) Or DOC1=" ") Then DOC1 = A Else DOC1.

Somehow, this logic is not catching the blanks on the DOC1, Is there a way to check for the SPACES on this field?

Thanks
srimitta
Premium Member
Premium Member
Posts: 187
Joined: Sun Apr 04, 2004 7:50 pm

Post by srimitta »

If Len(Trim(DOC1)) < 1 Then 'A' Else DOC1
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Post by Shree0410 »

Thanks for the help, it worked.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This can not work in a parallel job, where a CHAR must contain the correct number of 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