Page 1 of 1

Trim on DS-Aix Vs DS-Windows

Posted: Thu Dec 07, 2006 2:31 am
by mouni
Hi,
We ported our DS jobs from AIX to Windows Server. During compilation on Windows we faced a problem with Trim(String,'D') and Trim(String,' ','B') functions. This was working fine on Aix system.
When we changed this to just Trim(String), it compiled and executed fine on Windows.

Is this a problem with DS not implementing Trim properly for Windows? or should I use it in a different way on Windows?

Posted: Thu Dec 07, 2006 2:34 am
by kumar_s
What was the error message prompted when you compile in Windows environment?

Posted: Thu Dec 07, 2006 2:45 am
by mouni
Here is the log:

Output from transformer compilation follows:

Output from transformer compilation follows:

##I TFCN 000001 15:24:09(000) <main_program>
Ascential DataStage(tm) Enterprise Edition 7.5
Copyright (c) 2004, 1997-2004 Ascential Software Corporation.
All Rights Reserved


##I TOSH 000002 15:24:09(001) <main_program> orchgeneral: loaded
##I TOSH 000002 15:24:09(002) <main_program> orchsort: loaded
##I TOSH 000002 15:24:09(003) <main_program> orchstats: loaded
##W TFPA 000012 15:24:10(000) <main_program> Warning: the PWD environment variable is not defined. Remote process startup may be unsuccessful as a result.If your ORCHESTRATE job does not start up correctly, please set your PWD variable to a value that will work on all nodes of your system.
##E TBLD 000000 15:24:12(000) <main_program> Error when checking composite operator: Subprocess command failed with exit status 512
##E TFSR 000019 15:24:12(001) <main_program> Could not check all operators because of previous error(s)
##W TFCP 000000 15:24:12(002) <transform> Error when checking composite operator: The number of reject datasets "0"is less than the number of input datasets "1".
##W TFCP 000025 15:24:12(003) <transform> Error when checking composite operator: Converting number to string
##W TFCP 000000 15:24:12(004) <transform> Error when checking composite operator: Implicit conversion from source type "Int32" to result type "String".
##W TFCP 000025 15:24:12(005) <transform> Error when checking composite operator: Converting number to string
##W TFCP 000000 15:24:12(006) <transform> Error when checking composite operator: Implicit conversion from source type "Int32" to result type "String".
##I TFCP 000008 15:24:12(007) <transform> Error when checking composite operator: cxx -O -IC:/Ascential/DataStage/PXEngine/include -W/TP -W/EHa -DAPT_USE_ANSI_IOSTREAMS -c C:/Ascential/DataStage/Projects/FirstProject/RT_BP85.O/V1S1_TrimTest_TransStage1.C -o C:/Ascential/DataStage/Projects/FirstProject/RT_BP85.O/V1S1_TrimTest_TransStage1.tmp.o
##I TBLD 000000 15:24:12(008) <main_program> Error when checking composite operator: Output from subprocess: C:\Ascential\DataStage\Projects\FirstProject\RT_BP85.O\V1S1_TrimTest_TransStage1.C(243) : warning C4244: '=' : conversion from 'APT_Int64' to 'int', possible loss of data
C:\Ascential\DataStage\Projects\FirstProject\RT_BP85.O\V1S1_TrimTest_TransStage1.C(474) : error C2143: syntax error : missing ')' before ';'
C:\Ascential\DataStage\Projects\FirstProject\RT_BP85.O\V1S1_TrimTest_TransStage1.C(475) : warning C4390: ';' : empty controlled statement found; is this the intent?
C:\Ascential\DataStage\Projects\
##I TBLD 000000 15:24:12(009) <main_program> Error when checking composite operator: Output from subprocess: FirstProject\RT_BP85.O\V1S1_TrimTest_TransStage1.C(475) : error C2143: syntax error : missing ';' before '=='
C:\Ascential\DataStage\Projects\FirstProject\RT_BP85.O\V1S1_TrimTest_TransStage1.C(475) : error C2059: syntax error : ')'
C:\Ascential\DataStage\Projects\FirstProject\RT_BP85.O\V1S1_TrimTest_TransStage1.C(476) : error C2143: syntax error : missing ';' before '{'
C:\Ascential\DataStage\Projects\FirstProject\RT_BP85.O\V1S1_TrimTest_TransStage1.C(479) : error C2181: illegal else without matching if
##I TBLD 000000 15:24:12(010) <main_program> Error when checking composite operator: Output from subprocess:

##E TCOS 000029 15:24:12(011) <main_program> Creation of step finished with status = FAILED (TrimTest.TransStage1)

*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V1S1_repos_TransStage1 transform operator.
0003: //
0004:
0005: // define our input/output link names
0006: inputname 0 LnkGenerate;
0007: outputname 0 LnkOutStage1;
0008:
0009: initialize {
0010: // define our row rejected variable
0011: int8 RowRejected0;
0012:
0013: // define our null set variable
0014: int8 NullSetVar0;
0015:
0016: // declare our intermediate variables for this section
0017: string InterVar0_0;
0018: string InterVar0_1;
0019: string InterVar0_2;
0020: string InterVar0_3;
0021: string InterVar0_4;
0022:
0023: // initialise constant values which require conversion
0024: InterVar0_0 = 0;
0025: InterVar0_1 = " ";
0026: InterVar0_2 = "B";
0027: InterVar0_3 = "";
0028: InterVar0_4 = 1;
0029: // Stage variable declaration and initialisation
0030: string StageVar0_Counter;
0031: StageVar0_Counter = InterVar0_0;
0032: }
0033:
0034: mainloop {
0035: // initialise our row rejected variable
0036: RowRejected0 = 1;
0037:
0038: // evaluate the stage variables first
0039: if ((trimc_string(LnkGenerate.Name , InterVar0_1 , InterVar0_2) == InterVar0_3)) {
0040: StageVar0_Counter = InterVar0_4;
0041: } else {
0042: StageVar0_Counter = InterVar0_0;
0043: }
0044: //;
0045:
0046: // evaluate columns (no constraints) for link: LnkOutStage1
0047: LnkOutStage1.Name = trimc_string(LnkGenerate.Name , InterVar0_1 , InterVar0_2);
0048: writerecord 0;
0049: RowRejected0 = 0;
0050: }
0051:
0052: finish {
0053: }
0054:
*** End of Internal Generated Transformer Code

Posted: Thu Dec 07, 2006 3:01 am
by kumar_s
This sounds interesting that the job got compiled after changing the Trim option. Usually these sort of error will lead to the work on the compiler liecence or the expiry date of it. PWD may also need to be set in Environmental variable.
How about other jobs, does it all compile without any issues?

Posted: Thu Dec 07, 2006 3:32 am
by mouni
Yup, all other jobs compile and execute without any problems. Even this job worked fine when Trim() was changed.

Posted: Thu Dec 07, 2006 3:51 am
by ArndW
This looks like a good and easy to reproduce problem to submit to your support provider; it does look like a difference in the C++ compilers between AIX and Windows. If you look at your generated source code and find the trim() function you can check it against the Visual Studio documentation.

Posted: Thu Dec 07, 2006 3:53 am
by mouni
Just did several sample jobs and identified the point where it is going wrong on Windows:

The below statement works fine on Unix, But on Windows this gives compilation problem.
IF Trim(LnkGenerate.Name," ","B")='' THEN 1 ELSE 0

One surprising thing is that Trim(LnkGenerate.Name," ","B") as a stand-alone statement i.e., not as a condition in IF statement compiles fine on Windows!!! :?: