Job aborts - Alpha function

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
wfis
Premium Member
Premium Member
Posts: 70
Joined: Wed Feb 28, 2007 2:38 am
Location: India

Job aborts - Alpha function

Post by wfis »

Hi All,


I have used the Alpha function and handled NULL but it yet does not work and gives warning

If Trim(Lnk_Read_ds.NAME_LINE)='' Or IsNull(Lnk_Read_ds.NAME_LINE) Then 0 Else If Alpha(Trim(Trim(Trim(Lnk_Read_ds.NAME_LINE),'-','A'),' ','A')[2,39]) Then 1 Else 0

Error is "Null String Argument"

Any help

Thanks
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

I think the problem is to do with:

Code: Select all

Trim(Lnk_Read_ds.NAME_LINE)=''
Trim will not take kindly to a null value as input

try this:

Code: Select all

If Trim(NullToEmpty(Lnk_Read_ds.NAME_LINE))='' Then 0 Else If Alpha(Trim(Trim(Trim(Lnk_Read_ds.NAME_LINE),'-','A'),' ','A')[2,39]) Then 1 Else 0 
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
wfis
Premium Member
Premium Member
Posts: 70
Joined: Wed Feb 28, 2007 2:38 am
Location: India

Post by wfis »

Thanks its working now.
Post Reply