How to debug Phantom?

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
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

How to debug Phantom?

Post by nsm »

HI All,

When I run a job I got a Phantom.

Here is the detail message I am posting, plz let me know how to debug this.

DataStage Job 1 Phantom 18105
Program "JOB.303421124.DT.1326348161.TRANS1": Line 199, Variable previously undefined. Zero length string used.
Program "JOB.303421124.DT.1326348161.TRANS1": Line 218, Variable previously undefined. Zero length string used.
Program "DSD.StageRun": Line 749, Variable "$R62" previously undefined. Empty string used.
DataStage Phantom Finished

Thanks
nsm.
kiran_kom
Participant
Posts: 29
Joined: Mon Jan 12, 2004 10:51 pm

Post by kiran_kom »

Describe your job.
What are you doing thats causing this error?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"Phantom" simply means "background process" in DataStage terminology.

The message you're getting indicates that somewhere in your job design a variable is not being assigned. This could be in a stage variable not being initialized, or it may be in a Routine invoked from an expression in the Transformer stage.

Examining the files in RT_BP1 directory in your project may help you to diagnose what's happening (or not happening). The file named JOB.303421124.DT.1326348161.TRANS1 is code generated by your Transformer stage; line numbers reported in the error message are approximate line numbers in this code.

You have not provided sufficient information for us to be of any more help.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

Post by nsm »

Thanks Ray.

I know what's causing phantom now.
but i donno how to get rid of that.

I have a routine where it returns 0 or 1.
The return value from routine i am storing in a stage variable and i am using that for filtering the records in the constraint logic.
(I remember it worked in previous versions, now i am on 7x)
I am not assigning the stage variable to anything.

if i debug the job i am not getting this phantom error.
I am getting this only when i am running the job.

can you give me the work around for this?

Thanks
nsm.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not without seeing the code for the routine! :D
Somewhere in that code there is a path through the code that allows a variable (perhaps Ans) not to be assigned a value before that variable is used.
There is no workaround. It must be fixed. If it's not too sensitive, post the routine code here, and we'll look at it. Or, given the above advice, you may solve it yourself.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

Post by nsm »

Here is the code I am using in the routine:
I couldn't see anything wrong in here.

deffun CheckVal(Arg1,Arg2)

if Arg2 = "1" then
if Arg1="a" or Arg1="b" or Arg1="c" then Ans = 0 else Ans = 1
end

else if Arg2 = "2" then
if Arg1="d" or Arg1="e" or Arg1="f" then Ans = 0 else Ans = 1
end

else if Arg2 = "3" then
if Arg1="a" or Arg1="d" or Arg1="e" then Ans = 0 else Ans = 1
end
cnorris
Premium Member
Premium Member
Posts: 3
Joined: Tue Oct 14, 2003 9:23 am

Post by cnorris »

I suggest you set a default value for Ans before you start. My guess is that you are getting values other than the ones you have programed for.
CN
nsm wrote:Here is the code I am using in the routine:
I couldn't see anything wrong in here.

deffun CheckVal(Arg1,Arg2)

if Arg2 = "1" then
if Arg1="a" or Arg1="b" or Arg1="c" then Ans = 0 else Ans = 1
end

else if Arg2 = "2" then
if Arg1="d" or Arg1="e" or Arg1="f" then Ans = 0 else Ans = 1
end

else if Arg2 = "3" then
if Arg1="a" or Arg1="d" or Arg1="e" then Ans = 0 else Ans = 1
end
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Looks like there's a chance Arg2 isn't one of 1, 2 or 3 in your data.
This situation would leave Ans unassigned.
Always initialize the Ans variable, even if you use Ans = @NULL.
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