Page 1 of 1

Improper data type

Posted: Thu Mar 01, 2007 2:44 am
by PeterPol
Hi all,

I imported succesfully an external function in Datastage. This created the following transform function:

*****************************************
$INCLUDE DSINCLUDE DSOLETYPES.H

str1 = Arg1

* Automation Class name and OLE function name
SNAME = 'UltraDLL.UltraDLLObject'
MNAME = 'ultradll_splitsadres'

* Initialise return variable and it's type
Ans = 0
RETTYPE = DSOLE.RTYPE.LONG
ARGTYPES = DSOLE.ATYPE.STRING

CALL $DSOLE.Dispatch.Method.1Args(SNAME, MNAME, RETTYPE, Ans, ARGTYPES, Arg1)
********************************

When I compile this routine I get the following warning:

WARNING: Assignment to variable str1 on line 4 will modify an input argument. If input link column variables are used as arguments to this routine then DataStage runtime may fail.
Compiled with no errors

I then removed the assignment str1 = Arg1 after which the routine compiled without errors. Why is this assignment inserted in the first place?

Furthermore, when I test this routine I get the following error:

TEST #1
*******

Arg1 = test

Test failed.

Program "DSD.WriteLog": Line 265, Improper data type.

Any idea what can be the problem?

Peter

Posted: Fri Mar 02, 2007 2:13 am
by PeterPol
hi,

Is there someone who can help me with this problem?

Peter

Posted: Fri Mar 02, 2007 3:45 am
by kumar_s
What if you comment that assignment line and compile?

Posted: Fri Mar 02, 2007 3:55 am
by PeterPol
Hello,

In that case the routine compiles without warnings. However, when I test the routine I still get the same error.

Peter

Posted: Fri Mar 02, 2007 4:01 am
by kumar_s
Could you locate "Line 265" in what? Was there any job no given in at any place?

Posted: Fri Mar 02, 2007 4:14 am
by PeterPol
- I don't know where to find DSD.WriteLog?
- As far as I can see/understand, the routine that was generated during the import, only contains a call to the activex function

Peter

Posted: Fri Mar 02, 2007 5:21 am
by ray.wurlod
Where did you find the "$" syntax for a CALL statement? This normally means a GCI call, which means that a reference to the function must exist within the General Call Interface mechanism.

How are you invoking your server routine in a parallel job? Is it within a server shared container, or within a BASIC Transformer stage?

Posted: Fri Mar 02, 2007 5:40 am
by PeterPol
Hi,

The routine with the call statement was automatically created by Datastage as a result of importing an activex dll function (External Function Definition in DSManager).

I tested the routine within the routine itself (button Test...). I haven't tried to call the routine from a transformer

Peter

Posted: Fri Mar 02, 2007 5:50 am
by ds_developer
Please clarify if Arg1 is an input, input/output or output parameter. Way back on v6.01 the code generated by an import function incorrectly identifed the parameters. I doubt it has changed.

If Arg1 is an output parameter, change to
ARGTYPES = DSOLE.ATYPE.REFSTRING

I'm not sure what to set it to if it is a input/output parameter, but you might try.

John

Posted: Fri Mar 02, 2007 7:42 am
by PeterPol
Hi,

Arg1 is an input-only parameter.

I already tried your suggestion but that didnt work too. :(

Peter

Posted: Wed Jul 11, 2007 10:39 am
by Latha1919
Could any one suggest the root cause for this issue. I am encountering this issue when the function has to return some speacial characters. However, if there are no special characters in the data, routine is working fine.

Any ideas?

Thanks,
Latha