Routine C++ compiling issue

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

Routine C++ compiling issue

Post by Jeroens »

Hi guys,

I'm having an issue with creating a C++ parallel routine. I have this simple CPP code (IntTest.cpp):

Code: Select all

#include <stdio.h>
int trans(int i)
{
   if(i>5)
     return i;
   else
     return i+5;
}
What I've done so far:
1. Created an parrelel routine
Routine name: myRoutine
External subroutine name: trans
Type: External Function
Object Type: Object
Return type: int
Library path: C:\DS_Adv_BC\Dev\IntTest

-Arguments tab-
Argument name: i
I/O type: I
Native type: int

2. Add the routine in the transformer, compiled.


Output from transformer compilation follows:

##I IIS-DSEE-TFCN-00001 07:46:54(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 07:46:54(001) <main_program> conductor uname: -s=Windows_NT; -r=1; -v=5; -n=VMWARE-IMG; -m=Pentium
##I IIS-DSEE-TOSH-00002 07:46:54(002) <main_program> orchgeneral: loaded
##I IIS-DSEE-TOSH-00002 07:46:54(003) <main_program> orchsort: loaded
##I IIS-DSEE-TOSH-00002 07:46:54(004) <main_program> orchstats: loaded
##W IIS-DSEE-TOSH-00049 07:46:55(002) <main_program> Parameter specified but not used in flow: DSPXWorkingDir [osl\osl.C:623]
##I IIS-DSEE-TCOS-00021 07:46:55(003) <main_program> Echo:
transform -inputschema record
(
test:int32;
)
-outputschema record
(
test:int32;
)
-expressionfile RT_SC154/V0S2_TestInt_Transformer_2.trx
-flag compile
-staticobj 'C:/DS_Adv_BC/Dev/IntTest'
-compiler 'cxx'
-compileopt '-W/TP -W/EHa -DAPT USE ANSI IOSTREAMS -c '
-linker 'cxx'
-linkopt '-s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-'
-name V0S2_TestInt_Transformer_2
-dir D:/IBM/InformationServer/Server/Projects/Training/RT_BP154.O
.
##W IIS-DSEE-TOSH-00049 07:46:55(004) <main_program> Parameter specified but not used in flow: DSPXWorkingDir [osl\osl.C:623]
##I IIS-DSEE-TCOS-00022 07:46:55(006) <main_program> Explanation:
Step has 1 operator.
???, invoked with args: -inputschema record ( test: int32; ) -outputschema record ( test: int32; ) -expressionfile RT_SC154/V0S2_TestInt_Transformer_2.trx -flag compile -staticobj C:/DS_Adv_BC/Dev/IntTest -compiler cxx -compileopt -W/TP -W/EHa -DAPT USE ANSI IOSTREAMS -c -linker cxx -linkopt -s -W/dll -W/base:0x50000000 -W/Zc:wchar_t- -name V0S2_TestInt_Transformer_2 -dir D:/IBM/InformationServer/Server/Projects/Training/RT_BP154.O

Step has 0 data entities.
.
##I IIS-DSEE-TCOS-00023 07:46:55(007) <main_program> Dump:
{
text="transform -inputschema record ( test: int32; )\r\n-outputschema record ( test: int32; )\r\n-expressionfile RT_SC154/V0S2_TestInt_Transformer_2.trx\r\n-flag compile\r\n-staticobj 'C:/DS_Adv_BC/Dev/IntTest'\r\n-compiler 'cxx'\r\n-compileopt '-W/TP -W/EHa -DAPT USE ANSI IOSTREAMS -c '\r\n-linker 'cxx'\r\n-linkopt '-s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-'\r\n-name V0S2_TestInt_Transformer_2\r\n-dir D:/IBM/InformationServer/Server/Projects/Training/RT_BP154.O",
line=1, column=1, name="", qualname="",
op={
text="transform -inputschema record ( test: int32; )\r\n-outputschema record ( test: int32; )\r\n-expressionfile RT_SC154/V0S2_TestInt_Transformer_2.trx\r\n-flag compile\r\n-staticobj 'C:/DS_Adv_BC/Dev/IntTest'\r\n-compiler 'cxx'\r\n-compileopt '-W/TP -W/EHa -DAPT USE ANSI IOSTREAMS -c '\r\n-linker 'cxx'\r\n-linkopt '-s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-'\r\n-name V0S2_TestInt_Transformer_2\r\n-dir D:/IBM/InformationServer/Server/Projects/Training/RT_BP154.O",
line=1, column=1, name=transform, qualname=transform,
wrapout={},
wrapperfile=transform, kind=non_wrapper_cdi_op, exec_mode=none,
args="'record ( test: int32; )'-outputschema'record ( test: int32; )'-expressionfile'RT_SC154/V0S2_TestInt_Transformer_2.trx'-flag'compile'-staticobj'C:/DS_Adv_BC/Dev/IntTest'-compiler'cxx'-compileopt'-W/TP -W/EHa -DAPT USE ANSI IOSTREAMS -c '-linker'cxx'-linkopt'-s -W/dll -W/base:0x50000000 -W/Zc:wchar_t-'-name'V0S2_TestInt_Transformer_2'-dir'D:/IBM/InformationServer/Server/Projects/Training/RT_BP154.O'"
}
}
.
##E IIS-DSEE-TBLD-00076 07:47:21(000) <main_program> Error when checking composite operator: Subprocess command failed with exit status 40,192. [buildop\compile.C:594]
##E IIS-DSEE-TFSR-00019 07:47:21(001) <main_program> Could not check all operators because of previous error(s) [api\step_rep.C:1186]
##W IIS-DSEE-TFTM-00012 07:47:21(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 07:47:21(003) <main_program> Error when checking composite operator: Output from subprocess: Unknown parameter USE (ignored)
Unknown parameter ANSI (ignored)
Unknown parameter IOSTREAMS (ignored)

##I IIS-DSEE-TBLD-00000 07:47:21(004) <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_BP154.O\V0S2_TestInt_Transformer_2.C(182) : warning C4101: 'output' : unreferenced local variable
D:\IBM\InformationServer\Server\Projec
##W IIS-DSEE-TFEV-00025 07:47:21(005) <transform> Error when checking composite operator: Converting number to string. [transform\evalexp.C:5683]
##W IIS-DSEE-TFEV-00023 07:47:21(006) <transform> Error when checking composite operator: Implicit conversion from source type "Int32" to result type "String". [transform\evalexp.C:5687]
##I IIS-DSEE-TBLD-00000 07:47:21(007) <main_program> Error when checking composite operator: Output from subprocess: ts\Training\RT_BP154.O\V0S2_TestInt_Transformer_2.C(177) : warning C4101: 'input' : unreferenced local variable
D:\IBM\InformationServer\Server\Projects\Training\RT_BP154.O\V0S2_TestInt_Transformer_2.C(283) : warning C4244: '=' : conversion from 'double' to 'APT_Int32', possible loss of data

##W IIS-DSEE-TFEV-00025 07:47:21(008) <transform> Error when checking composite operator: Converting string to number. [transform\evalexp.C:5683]
##W IIS-DSEE-TFEV-00023 07:47:21(009) <transform> Error when checking composite operator: Implicit conversion from source type "String" to result type "Int32". [transform\evalexp.C:5687]
##I IIS-DSEE-TBLD-00079 07:47:21(010) <transform> Error when checking composite operator: cxx -LD:/IBM/InformationServer/Server/Projects/Training/RT_BP154.O/ -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 C:/DS_Adv_BC/Dev/IntTest.o D:/IBM/InformationServer/Server/Projects/Training/RT_BP154.O/V0S2_TestInt_Transformer_2.tmp.o -o D:/IBM/InformationServer/Server/Projects/Training/RT_BP154.O/V0S2_TestInt_Transformer_2.dll.
##I IIS-DSEE-TBLD-00000 07:47:21(011) <main_program> Error when checking composite operator: Output from subprocess: LINK : fatal error LNK1181: cannot open input file 'C:\DS_Adv_BC\Dev\IntTest.o'

##E IIS-DSEE-TCOS-00029 07:47:21(012) <main_program> Creation of a step finished with status = FAILED. [osh.C:1081] (TestInt.Transformer_2)

*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S2_TestInt_Transformer_2 transform operator.
0003: //
0004:
0005: // define external functions used
0006: extern int32 trans(int32 i);
0007:
0008: // define our input/output link names
0009: inputname 0 DSLink3;
0010: outputname 0 DSLink4;
0011:
0012: initialize {
0013: // define our row rejected variable
0014: int8 RowRejected0;
0015:
0016: // define our null set variable
0017: int8 NullSetVar0;
0018:
0019: // Stage variable declaration and initialisation
0020: string StageVar0_StageVar;
0021: StageVar0_StageVar = "";
0022: }
0023:
0024: mainloop {
0025: // initialise our row rejected variable
0026: RowRejected0 = 1;
0027:
0028: // evaluate the stage variables first
0029: StageVar0_StageVar = trans(DSLink3.test);
0030:
0031: // evaluate columns (no constraints) for link: DSLink4
0032: DSLink4.test = StageVar0_StageVar;
0033: writerecord 0;
0034: RowRejected0 = 0;
0035: }
0036:
0037: finish {
0038: }
0039:
*** End of Internal Generated Transformer Code


I think it has something to do with:
Output from subprocess: LINK : fatal error LNK1181: cannot open input file 'C:\DS_Adv_BC\Dev\IntTest.o'

I appreciate your help, thanks in advance
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

What are the permissions on the object file ?
Jeroens
Participant
Posts: 9
Joined: Wed Mar 20, 2013 8:05 am

Post by Jeroens »

I've used a lib file and for some reason he is able to open the file. But now I'm getting a different error message:

Output from transformer compilation follows:

Code: Select all

##I IIS-DSEE-TFCN-00001 02:05:13(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 02:05:13(001) <main_program> conductor uname: -s=Windows_NT; -r=1; -v=5; -n=VMWARE-IMG; -m=Pentium
##I IIS-DSEE-TOSH-00002 02:05:13(002) <main_program> orchgeneral: loaded
##I IIS-DSEE-TOSH-00002 02:05:13(003) <main_program> orchsort: loaded
##I IIS-DSEE-TOSH-00002 02:05:13(004) <main_program> orchstats: loaded
##W IIS-DSEE-TOSH-00049 02:05:14(000) <main_program> Parameter specified but not used in flow: DSPXWorkingDir [osl\osl.C:623]
##I IIS-DSEE-TCOS-00021 02:05:14(001) <main_program> Echo:
transform -inputschema record
(
  bedrag:dfloat;
)
-outputschema record
(
  bedrag:nullable dfloat;
)
-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 02:05:14(002) <main_program> Parameter specified but not used in flow: DSPXWorkingDir [osl\osl.C:623]
##I IIS-DSEE-TCOS-00022 02:05:14(004) <main_program> Explanation:
Step has 1 operator.
???, invoked with args: -inputschema record ( bedrag: dfloat; ) -outputschema record ( bedrag: nullable dfloat; ) -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 02:05:14(005) <main_program> Dump:
{ 
  text="transform -inputschema record ( bedrag: dfloat; )\r\n-outputschema record ( bedrag: nullable dfloat; )\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: dfloat; )\r\n-outputschema record ( bedrag: nullable dfloat; )\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: dfloat; )'-outputschema'record ( bedrag: nullable dfloat; )'-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 02:05:47(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 02:05:47(001) <main_program> Could not check all operators because of previous error(s) [api\step_rep.C:1186]
##W IIS-DSEE-TFTM-00012 02:05:47(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 02:05:47(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 02:05:47(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

##W IIS-DSEE-TFEV-00025 02:05:47(005) <transform> Error when checking composite operator: Converting number to string. [transform\evalexp.C:5683]
##W IIS-DSEE-TFEV-00023 02:05:47(006) <transform> Error when checking composite operator: Implicit conversion from source type "Int8" to result type "String". [transform\evalexp.C:5687]
##W IIS-DSEE-TFEV-00025 02:05:47(007) <transform> Error when checking composite operator: Converting string to number. [transform\evalexp.C:5683]
##W IIS-DSEE-TFEV-00023 02:05:47(008) <transform> Error when checking composite operator: Implicit conversion from source type "String" to result type "DFloat". [transform\evalexp.C:5687]
##I IIS-DSEE-TBLD-00079 02:05:47(009) <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 02:05:47(010) <main_program> Error when checking composite operator: Output from subprocess: V9S3_bedragfunctie_Transformer_2.tmp.o : error LNK2019: unresolved external symbol "signed char __cdecl format(double)" (?format@@YACN@Z) 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)

##I IIS-DSEE-TBLD-00000 02:05:47(011) <main_program> Error when checking composite operator: Output from subprocess: D:\IBM\InformationServer\Server\Projects\Training\RT_BP153.O\V9S3_bedragfunctie_Transformer_2.dll : fatal error LNK1120: 1 unresolved externals

##E IIS-DSEE-TCOS-00029 02:05:47(012) <main_program> Creation of a step finished with status = FAILED. [osh.C:1081] (bedragfunctie.Transformer_2)

For your information, I'm using a code that replaces a dot for a comma and sets to 2 decimal places:

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <locale.h>

using namespace std;

char * format(double d, char *buf) {
  char *loc = setlocale(LC_ALL, NULL);
  setlocale(LC_ALL, "nl_NL.utf-8");
  sprintf(buf, "%.2f", d);
  loc = setlocale(LC_ALL, loc); // restore locale
  return buf;
}

int main(int argc, char** argv) {
  if (argc != 2 || atof(argv[1]) == 0.0) {
    cerr << "Usage: " << argv[0] << " <number>\n";
    return 1;

  } else {
    char formatted_value[255];
    cout << format(atof(argv[1]), formatted_value) << "\n";
    return 0;
  }
}
I'm using "argv" (double) as argument name in the routine.

Have you any idea what is going wrong?
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

As this is a Windows environment, did you properly create a dll library containing your parallel routine, as is documented?

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Jeroens
Participant
Posts: 9
Joined: Wed Mar 20, 2013 8:05 am

Post by Jeroens »

That's correct. For some reason it's failing when I'm using an object file. So I've used a dll library.

New update on this issue;
I've amended the external subroutine name to 'main' and argument name to 'argv' (double). I'm now getting the following error message:

Parallel job reports failure (code -1073741819)

Anybody familiar with this error message??

CPP code is still the same:

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <locale.h>

using namespace std;

char * format(double d, char *buf) {
  char *loc = setlocale(LC_ALL, NULL);
  setlocale(LC_ALL, "nl_NL.utf-8");
  sprintf(buf, "%.2f", d);
  loc = setlocale(LC_ALL, loc); // restore locale
  return buf;
}

int main(int argc, char** argv) {
  if (argc != 2 || atof(argv[1]) == 0.0) {
    cerr << "Usage: " << argv[0] << " <number>\n";
    return 1;

  } else {
    char formatted_value[255];
    cout << format(atof(argv[1]), formatted_value) << "\n";
    return 0;
  }
}
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A DataStage parallel routine can not be named "main".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Jeroens
Participant
Posts: 9
Joined: Wed Mar 20, 2013 8:05 am

Post by Jeroens »

So I need to create a routine without a main() function. That's a challenge :)
Jeroens
Participant
Posts: 9
Joined: Wed Mar 20, 2013 8:05 am

Post by Jeroens »

I found out that a routine doesn't make use of the main function. Why? Something to do with the entry points?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

main() always indicates a stand-alone (rather than callable) executable module. Use the name of your routine as the function name.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Jeroens
Participant
Posts: 9
Joined: Wed Mar 20, 2013 8:05 am

Post by Jeroens »

I've used main() as an External subroutine name: This is the actual function name in the C++ code.

So I've simplified the code and erased the main() function:

char * format(double d, char *buf) {
char *loc = setlocale(LC_ALL, NULL);
setlocale(LC_ALL, "nl_NL.utf-8");
sprintf(buf, "%.2f", d);
setlocale(LC_ALL, loc); // restore locale
return buf;
}

In this case I've determined "format" as an External Subroutine Name. Yet, it still not compiling.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is it legal to use setlocale() as an rvalue and as an lvalue?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Jeroens
Participant
Posts: 9
Joined: Wed Mar 20, 2013 8:05 am

Post by Jeroens »

Well noted Ray. To avoid this, let's make the code more simplified:

Code: Select all

char * format(double d, char *buf) {
  sprintf(buf, "%.2f", d);
  return buf;
}

Parallel Routine setting:
External subroutine name: format
Type: External Function
Return type: char
Argument name: d (native type: double)

(column name:
source: bedrag (double),
target: bedrag (char) )

Compiling error:
Output from transformer compilation follows:

##I IIS-DSEE-TFCN-00001 02:49:55(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 02:49:55(001) <main_program> conductor uname: -s=Windows_NT; -r=1; -v=5; -n=VMWARE-IMG; -m=Pentium
##I IIS-DSEE-TOSH-00002 02:49:55(002) <main_program> orchgeneral: loaded
##I IIS-DSEE-TOSH-00002 02:49:55(003) <main_program> orchsort: loaded
##I IIS-DSEE-TOSH-00002 02:49:55(004) <main_program> orchstats: loaded
##W IIS-DSEE-TOSH-00049 02:49:56(000) <main_program> Parameter specified but not used in flow: DSPXWorkingDir [osl\osl.C:623]
##I IIS-DSEE-TCOS-00021 02:49:56(001) <main_program> Echo:
transform -inputschema record
(
bedrag:dfloat;
)
-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 02:49:56(002) <main_program> Parameter specified but not used in flow: DSPXWorkingDir [osl\osl.C:623]
##I IIS-DSEE-TCOS-00022 02:49:56(004) <main_program> Explanation:
Step has 1 operator.
???, invoked with args: -inputschema record ( bedrag: dfloat; ) -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 02:49:56(005) <main_program> Dump:
{
text="transform -inputschema record ( bedrag: dfloat; )\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: dfloat; )\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: dfloat; )'-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 02:50:07(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 02:50:07(001) <main_program> Could not check all operators because of previous error(s) [api\step_rep.C:1186]
##W IIS-DSEE-TFTM-00012 02:50:07(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 02:50:07(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 02:50:07(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 02:50:07(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 02:50:07(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 format(double)" (__imp_?format@@YAPADN@Z) 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_bedragfuncti
##I IIS-DSEE-TBLD-00000 02:50:07(007) <main_program> Error when checking composite operator: Output from subprocess: e_Transformer_2.dll : fatal error LNK1120: 1 unresolved externals

##E IIS-DSEE-TCOS-00029 02:50:07(008) <main_program> Creation of a step finished with status = FAILED. [osh.C:1081] (bedragfunctie.Transformer_2)
Post Reply