Transformer Compilation Error

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Pavani_Vithala
Participant
Posts: 7
Joined: Mon Mar 05, 2007 3:25 am

Transformer Compilation Error

Post by Pavani_Vithala »

Hi,
I am trying to call a C++ routine in a parellel job in a transformer. But I am getting an error as below. Please some one let me know how to create a C++ function,place it in what folder and how to call it step by step. It will be of great help.

Thanks in advance

Pavani Vithala

Error generated

Output from transformer compilation follows:

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


##I TOSH 000002 08:03:25(000) <main_program> orchgeneral: loaded
##I TOSH 000002 08:03:25(001) <main_program> orchsort: loaded
##I TOSH 000002 08:03:25(002) <main_program> orchstats: loaded
##I TFSC 000001 08:03:25(005) <main_program> APT configuration file: /datahub/dsadm/Ascential/DataStage/Configurations/2node2scratchremote.apt
##W TCOS 000049 08:03:25(006) <main_program> Parameter specified but not used in flow: DSPXWorkingDir
##E TFCP 000003 08:03:25(008) <transform> Error when checking composite operator: Unexpected tokens: .; [line 6, character 20].
##E TFCP 000024 08:03:25(009) <transform> Error when checking composite operator: Incomplete function call ; [line 6, character 24].
##E TFCP 000038 08:03:25(010) <transform> Error when checking composite operator: Expected semi-colon; [line 6, character 24].
##E TFCP 000038 08:03:25(011) <transform> Error when checking composite operator: Expected semi-colon; [line 6, character 34].
##E TFCP 000038 08:03:25(012) <transform> Error when checking composite operator: Expected semi-colon; [line 9, character -1].
##E TFCP 000038 08:03:25(013) <transform> Error when checking composite operator: Expected semi-colon; [line 9, character 11].
##E TFCP 000038 08:03:25(014) <transform> Error when checking composite operator: Expected semi-colon; [line 10, character 0].
##E TFCP 000038 08:03:25(015) <transform> Error when checking composite operator: Expected semi-colon; [line 10, character 13].
##E TFCP 000038 08:03:25(016) <transform> Error when checking composite operator: Expected semi-colon; [line 29, character 34].
##E TFCP 000038 08:03:25(017) <transform> Error when checking composite operator: Expected semi-colon; [line 29, character 53].
##E TFSR 000019 08:03:25(018) <main_program> Could not check all operators because of previous error(s)
##E TCOS 000029 08:03:25(019) <main_program> Creation of a step finished with status = FAILED. (RangeCheck.stgXTrans)

*** Internal Generated Transformer Code follows:
0001: //
0002: // Generated file to implement the V0S10_repos_stgXTrans transform operator.
0003: //
0004:
0005: // define external functions used
0006: extern int32 libRange.so(int32 var1);
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: int32 StageVar0_RangeCheck;
0021: StageVar0_RangeCheck = 0;
0022: }
0023:
0024: mainloop {
0025: // initialise our row rejected variable
0026: RowRejected0 = 1;
0027:
0028: // evaluate the stage variables first
0029: StageVar0_RangeCheck = libRange.so(DSLink3.RangeValue);
0030:
0031: // evaluate constraint and columns for link: DSLink4
0032: if ((StageVar0_RangeCheck == 1))
0033: {
0034: writerecord 0;
0035: RowRejected0 = 0;
0036: }
0037: }
0038:
0039: finish {
0040: }
0041:
*** End of Internal Generated Transformer Code
Pavani Vithala
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

I beleive you have some suntax error in your routine ,can you send your routine that will help us to solve the issue.Are you using transformer or basic transformer?
hi sam here
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In particular look in and around line 20 of your routine. The error message complains of unexpected characters ".;" - can you see them there?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Pavani_Vithala
Participant
Posts: 7
Joined: Mon Mar 05, 2007 3:25 am

Post by Pavani_Vithala »

samsuf2002 wrote:I beleive you have some suntax error in your routine ,can you send your routine that will help us to solve the issue.Are you using transformer or basic transformer?
Hi,
My routine code is very simple as belwo. I am calling this routine in a transformer in a paralle job where i am passing an input column as variable. I am not getting any syntax error in the transformer. I eman no error when validating the stage variable

Below is my c++ routine

#include <iostream>
using namespace std;
int main(int var1)
{
if (var1 >= 1000 && var1 <= 1044)
{
return(0);
else
return(1);
}


}

The name of my routine is libRange.so

The way I am calling the routine is

1. I have created a stage variable say 'X'
2. Then I am calling the routine as libRange.So(<INPUTCOLUMN NAME>)


Regards,
Pavani
Pavani Vithala
Pavani_Vithala
Participant
Posts: 7
Joined: Mon Mar 05, 2007 3:25 am

Post by Pavani_Vithala »

ray.wurlod wrote:In particular look in and around line 20 of your routine. The error message complains of unexpected characters ".;" - can you see them there? ...
HI ray,
I don't see any such characters in my routine. There is only one opening flower brace in that line. There is nothing other than that in that line

Rgds,
Pavani
Pavani Vithala
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

This is not a routine but a complete program. Get rid of the main an change it to your function name. Test it out from command line by having a main function. Make sure it works. Then take out the main and compile the function again. Then call it from within datastage.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply