'Improper Data Type ' Error in Server Routine
Moderators: chulett, rschirm, roy
'Improper Data Type ' Error in Server Routine
We have written sever routine which does some multiplications based on certain conditions . The returning value from routine will be assigned to varchar2 field. We are getting ' Improper Data Type ' error when we run the job. The log mentions the line number of the routine and Datastgae Fantom aborting with with @ABORT.CODE = 3. Although not sure if it mentioning the correct line number ? Do we need to any type conversion here ?
-
- Participant
- Posts: 133
- Joined: Wed Mar 05, 2003 4:19 pm
- Location: Lima - Peru. Sudamerica
- Contact:
Re: 'Improper Data Type ' Error in Server Routine
Can you show the routine code to evaluate???
Saludos,
Miguel Seclén
Lima - Peru
Miguel Seclén
Lima - Peru
-
- Participant
- Posts: 133
- Joined: Wed Mar 05, 2003 4:19 pm
- Location: Lima - Peru. Sudamerica
- Contact:
Re: 'Improper Data Type ' Error in Server Routine
Can you show the routine code to evaluate???
Saludos,
Miguel Seclén
Lima - Peru
Miguel Seclén
Lima - Peru
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Without the code it's going to be difficult to determine. Improper data type usually arises from an attempt to use a file variable or subroutine variable that have not been properly assigned or which have subsequently been overwritten. However, there are other possible causes. Please post the routine code and the exact error message (complete).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sample code
Sample code
***Initialization section
Ans=""
v_cents_yen=""
v_cents=""
v_cycledate = CYCLE_DT
**If CRNCY OR QUOTED_CRNCY IS IN MINOR CURNCY SET FLAG =2
IF (FLAG = 2) THEN
v_yen=Index(UpCase(FUT_QTE_UNITS),"100 YEN",1)
if(v_yen > 0) then
if(num(PX_SETTLE) and TRIMB(PX_SETTLE_LAST_DT) = v_cycledate) then
Ans = PX_SETTLE * FACTOR * 0.01
end
else
return (-1)
end
end
else
if(num(PX_SETTLE) and TRIMB(PX_SETTLE_LAST_DT) = v_cycledate) then
Ans = PX_SETTLE * FACTOR
end
else
return (-1)
end
END
END
***Initialization section
Ans=""
v_cents_yen=""
v_cents=""
v_cycledate = CYCLE_DT
**If CRNCY OR QUOTED_CRNCY IS IN MINOR CURNCY SET FLAG =2
IF (FLAG = 2) THEN
v_yen=Index(UpCase(FUT_QTE_UNITS),"100 YEN",1)
if(v_yen > 0) then
if(num(PX_SETTLE) and TRIMB(PX_SETTLE_LAST_DT) = v_cycledate) then
Ans = PX_SETTLE * FACTOR * 0.01
end
else
return (-1)
end
end
else
if(num(PX_SETTLE) and TRIMB(PX_SETTLE_LAST_DT) = v_cycledate) then
Ans = PX_SETTLE * FACTOR
end
else
return (-1)
end
END
END
Re: Sample code
Your sample code when wrapped in 'code' tags:
First suggestion would be to replace the return statements with Ans assignments that denote an error condition. Pass the "-1" as the Answer if that's what you are going to check for to determine something has gone wrong in the routine.ds_my_job wrote:Sample code
Code: Select all
***Initialization section Ans="" v_cents_yen="" v_cents="" v_cycledate = CYCLE_DT **If CRNCY OR QUOTED_CRNCY IS IN MINOR CURNCY SET FLAG =2 IF (FLAG = 2) THEN v_yen=Index(UpCase(FUT_QTE_UNITS),"100 YEN",1) if(v_yen > 0) then if(num(PX_SETTLE) and TRIMB(PX_SETTLE_LAST_DT) = v_cycledate) then Ans = PX_SETTLE * FACTOR * 0.01 end else return (-1) end end else if(num(PX_SETTLE) and TRIMB(PX_SETTLE_LAST_DT) = v_cycledate) then Ans = PX_SETTLE * FACTOR end else return (-1) end END END
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers