'Improper Data Type ' Error in Server Routine

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
ds_my_job
Participant
Posts: 7
Joined: Wed Oct 24, 2007 11:27 pm

'Improper Data Type ' Error in Server Routine

Post by ds_my_job »

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 ?
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Re: 'Improper Data Type ' Error in Server Routine

Post by jseclen »

Can you show the routine code to evaluate???
Saludos,

Miguel Seclén
Lima - Peru
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Re: 'Improper Data Type ' Error in Server Routine

Post by jseclen »

Can you show the routine code to evaluate???
Saludos,

Miguel Seclén
Lima - Peru
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
ds_my_job
Participant
Posts: 7
Joined: Wed Oct 24, 2007 11:27 pm

Sample code

Post by ds_my_job »

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Sample code

Post by chulett »

Your sample code when wrapped in 'code' tags:
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
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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply