Parallel routine; return type CHAR (C++)

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Jeroens
Participant
Posts: 9
Joined: Wed Mar 20, 2013 8:05 am

Parallel routine; return type CHAR (C++)

Post by Jeroens »

Hi guys,

For some reason I'm having issues with parallel routines when it comes to the char type. To understand my issue, I will show it by a simple example. I'm using the following C++ script (source: http://dwbitutorials.wordpress.com/2013 ... outines-1/):

Code: Select all

#include <stdio.h>
#include <stdlib.h>
 
char * hello ()
{
char* s;
s="test";
return s;
}
General setting parallel routine:
External subroutine name: hello
Type: External Function
Object type: Library
Return type: char*

No arguments (script is output only)

I get this error message while compiling:
Output from transformer compilation follows:

##I IIS-DSEE-TFCN-00001 04:46:49(000) <main_program>
IBM WebSphere DataStage Enterprise Edition 8.1.0.4987
Copyright (c) 2001, 2005-2008 IBM Corporation. All rights reserved



##I IIS-DSEE-TFCN-00006 04:46:49(001) <main_program> conductor uname: -s=Windows_NT; -r=1; -v=5; -n=VMWARE-IMG; -m=Pentium
##I IIS-DSEE-TOSH-00002 04:46:50(000) <main_program> orchgeneral: loaded
##I IIS-DSEE-TOSH-00002 04:46:50(001) <main_program> orchsort: loaded
##I IIS-DSEE-TOSH-00002 04:46:50(002) <main_program> orchstats: loaded
##W IIS-DSEE-TOSH-00049 04:46:50(005) <main_program> Parameter specified but not used in flow: DSPXWorkingDir [osl\osl.C:623]
##I IIS-DSEE-TCOS-00021 04:46:50(006) <main_program> Echo:
transform -inputschema record
(
bedrag:string[];
)
-outputschema record
(
bedrag:nullable string[];
)
-expressionfile RT_SC153/V9S3_bedragfunctie_Transformer_2.trx
-flag compile
-sharedobj 'D:/IBM/InformationServer/Server/PXEngine/lib/try'
-compiler 'cxx'
-compileopt '-W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t-'
-linker 'cxx'
-linkopt '-s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-'
-name V9S3_bedragfunctie_Transformer_2
-dir D:/IBM/InformationServer/Server/Projects/Training/RT_BP153.O
.
##W IIS-DSEE-TOSH-00049 04:46:51(000) <main_program> Parameter specified but not used in flow: DSPXWorkingDir [osl\osl.C:623]
##I IIS-DSEE-TCOS-00022 04:46:52(001) <main_program> Explanation:
Step has 1 operator.
???, invoked with args: -inputschema record ( bedrag: string; ) -outputschema record ( bedrag: nullable string; ) -expressionfile RT_SC153/V9S3_bedragfunctie_Transformer_2.trx -flag compile -sharedobj D:/IBM/InformationServer/Server/PXEngine/lib/try -compiler cxx -compileopt -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t- -linker cxx -linkopt -s -W/dll -W/base:0x50000000 -W/Zc:wchar_t- -name V9S3_bedragfunctie_Transformer_2 -dir D:/IBM/InformationServer/Server/Projects/Training/RT_BP153.O

Step has 0 data entities.
.
##I IIS-DSEE-TCOS-00023 04:46:52(002) <main_program> Dump:
{
text="transform -inputschema record ( bedrag: string; )\r\n-outputschema record ( bedrag: nullable string; )\r\n-expressionfile RT_SC153/V9S3_bedragfunctie_Transformer_2.trx\r\n-flag compile\r\n-sharedobj 'D:/IBM/InformationServer/Server/PXEngine/lib/try'\r\n-compiler 'cxx'\r\n-compileopt '-W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t-'\r\n-linker 'cxx'\r\n-linkopt '-s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-'\r\n-name V9S3_bedragfunctie_Transformer_2\r\n-dir D:/IBM/InformationServer/Server/Projects/Training/RT_BP153.O",
line=1, column=1, name="", qualname="",
op={
text="transform -inputschema record ( bedrag: string; )\r\n-outputschema record ( bedrag: nullable string; )\r\n-expressionfile RT_SC153/V9S3_bedragfunctie_Transformer_2.trx\r\n-flag compile\r\n-sharedobj 'D:/IBM/InformationServer/Server/PXEngine/lib/try'\r\n-compiler 'cxx'\r\n-compileopt '-W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t-'\r\n-linker 'cxx'\r\n-linkopt '-s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-'\r\n-name V9S3_bedragfunctie_Transformer_2\r\n-dir D:/IBM/InformationServer/Server/Projects/Training/RT_BP153.O",
line=1, column=1, name=transform, qualname=transform,
wrapout={},
wrapperfile=transform, kind=non_wrapper_cdi_op, exec_mode=none,
args="'record ( bedrag: string; )'-outputschema'record ( bedrag: nullable string; )'-expressionfile'RT_SC153/V9S3_bedragfunctie_Transformer_2.trx'-flag'compile'-sharedobj'D:/IBM/InformationServer/Server/PXEngine/lib/try'-compiler'cxx'-compileopt'-W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c -W/Zc:wchar_t-'-linker'cxx'-linkopt'-s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-'-name'V9S3_bedragfunctie_Transformer_2'-dir'D:/IBM/InformationServer/Server/Projects/Training/RT_BP153.O'"
}
}
.
##E IIS-DSEE-TBLD-00076 04:47:02(000) <main_program> Error when checking composite operator: Subprocess command failed with exit status 24,576. [buildop\compile.C:594]
##E IIS-DSEE-TFSR-00019 04:47:02(001) <main_program> Could not check all operators because of previous error(s) [api\step_rep.C:1186]
##W IIS-DSEE-TFTM-00012 04:47:02(002) <transform> Error when checking composite operator: The number of reject datasets "0" is less than the number of input datasets "1". [transform\transform.C:1940]
##I IIS-DSEE-TBLD-00000 04:47:02(003) <main_program> Error when checking composite operator: Output from subprocess: D:\IBM\InformationServer\Server\PXEngine\include\apt_util/keylookup.h(1148) : warning C4251: 'APT_KeyLookupRange::rangeOptions_' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'APT_KeyLookupRange'
with
[
_Ty=APT_KeyLookupRange::rangeOption
]
D:\IBM\InformationServer\Server\Projects\Training\RT_BP153.O\V9S3_bedragfunctie_Transformer_2.C(182) : warning C4101: 'output' : unreferenced local variable
D:\IBM\InformationServer\Server\
##I IIS-DSEE-TBLD-00000 04:47:02(004) <main_program> Error when checking composite operator: Output from subprocess: Projects\Training\RT_BP153.O\V9S3_bedragfunctie_Transformer_2.C(177) : warning C4101: 'input' : unreferenced local variable

##I IIS-DSEE-TBLD-00079 04:47:02(005) <transform> Error when checking composite operator: cxx -LD:/IBM/InformationServer/Server/Projects/Training/RT_BP153.O/ -LD:/IBM/InformationServer/Server/PXEngine/lib/ -LD:/IBM/InformationServer/Server/PXEngine/lib -LD:/IBM/InformationServer/Server/PXEngine/user_lib -s -W/dll -W/base:0x50000000 -W/Zc:wchar_t- -lliborchnt -lliborchcorent -lliborchbuildopnt -llibtry D:/IBM/InformationServer/Server/Projects/Training/RT_BP153.O/V9S3_bedragfunctie_Transformer_2.tmp.o -o D:/IBM/InformationServer/Server/Projects/Training/RT_BP153.O/V9S3_bedragfunctie_Transformer_2.dll.
##I IIS-DSEE-TBLD-00000 04:47:02(006) <main_program> Error when checking composite operator: Output from subprocess: V9S3_bedragfunctie_Transformer_2.tmp.o : error LNK2019: unresolved external symbol "__declspec(dllimport) char * __cdecl hello(void)" (__imp_?hello@@YAPADXZ) referenced in function "protected: virtual void __thiscall APT_TransformOperatorImplV9S3_bedragfunctie_Transformer_2::processInputRecordChild(int,int * const,int * const)" (?processInputRecordChild@APT_TransformOperatorImplV9S3_bedragfunctie_Transformer_2@@MAEXHQAH0@Z)
D:\IBM\InformationServer\Server\Projects\Training\RT_BP153.O\V9S3_bedragfunctie_Tra
##I IIS-DSEE-TBLD-00000 04:47:02(007) <main_program> Error when checking composite operator: Output from subprocess: nsformer_2.dll : fatal error LNK1120: 1 unresolved externals

##E IIS-DSEE-TCOS-00029 04:47:02(008) <main_program> Creation of a step finished with status = FAILED. [osh.C:1081] (bedragfunctie.Transformer_2)
I think it has something to do with the return type. Because when I'm using a script with return type int, it works correctly. Please help me, thanks!
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post by zulfi123786 »

Change "Object type" to Object, I made a routine out of the above code and it ran fine
- Zulfi
Post Reply