Page 1 of 1

Phantom Error Not in Log for Debugger but it is for regular

Posted: Thu Apr 08, 2004 8:30 am
by larryoceanview
Why do I not get the phantom error in the log when running the debugger?, but it is in there for a regular run.

I am getting the following error which I received many times before and corrected by going to the line in the trans2 file in RT_BP(jobnumber).

DataStage Job 961 Phantom 20315
Program "JOB.1015626726.DT.1324648301.TRANS2": Line 2501, Nonnumeric data when numeric required. Zero used.

I used the function Num and IsNull with trim and my own scrubbing to verify that what I have is truly a number otherwise force a zero which is the default of the phantom error.

So basically I am looking for an answer to why the debugger does not write phantom errors to the job log and any other suggestions to finding the bad data. 8)

I can live with the warning in the log but I would rather know the reason why.

Thanks,
Larry

Posted: Thu Apr 08, 2004 8:54 am
by roy
Hi,
just a thought, have you tested for an empty string?

IHTH,

Posted: Thu Apr 08, 2004 8:59 am
by larryoceanview
roy wrote:Hi,
just a thought, have you tested for an empty string?

IHTH,
Is a empty string "", if it is I didn't, I thought IsNull will pick up an empty string. I think I misread the documentation. I'll try it.

Thanks,

Posted: Thu Apr 08, 2004 9:07 am
by roy
Hi,
Len(Trim(<string>)) will be equal to zero for both @NULL & empty string values.

IHTH,

Posted: Thu Apr 08, 2004 3:05 pm
by larryoceanview
roy wrote:Hi,
Len(Trim(<string>)) will be equal to zero for both @NULL & empty string values.

IHTH,
Didn't work, :shock: The problem is that I have about 500 thousand records on the input file and the log doesn't tell me which ones are having the problem. If I use the debugger everything is fine, no errors, can't see any visually. I can't isolate the bad records with intrinsic functions and tests. Maybe I'll create a function, pass my two parameters and see what happens! The error is currently screaming on addition of two stage variables and the subsequent mapping.

Thanks,
Larry

Posted: Thu Apr 08, 2004 5:17 pm
by ray.wurlod
Edit your breakpoint. Make it an expression such as (colname = "" Or IsNull(colname)). Hit Go; the job continues to execute until such a row occurs. THEN strap on the Sherlock Holmes gear!

A zero length string has a known value, and is therefore not NULL, and therefore it will not be detected by the IsNull() function.

DataStage has a particular internal representation of NULL, which is automatically and invisibly converted to when a NULL is encountered in source data.

In the Sequential File stage only, however, "" is treated as NULL by default, unless you override this on the Format tab. This has caught more than one DataStage developer!