Improper data type
Moderators: chulett, rschirm, roy
Improper data type
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
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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?
How are you invoking your server routine in a parallel job? Is it within a server shared container, or within a BASIC Transformer stage?
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.
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
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
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