Page 1 of 1

BuildOp: Compilation failing with Array

Posted: Wed Oct 12, 2011 1:24 am
by Kirtikumar
Hi,

I am trying to create a build op and below is the code used.

Def:

Code: Select all

char LKP_KEY[20000][100];
int LenLKP_KEY[20000];
char OutputCol[20000][100];

int UniqueLength[100];

int RecCounter, UniqueCounter, i, j, k;
Pre:

Code: Select all

i = 0;
j = 0;
k = 0;

  LenLKP_KEY[0] = 0;

  printf("Hello World!\n");
However when compiling I am getting an error:

Code: Select all

Operator Generation Failed

buildop -f -BC /usr/vacpp/bin/xlC_r -BL /usr/vacpp/bin/xlC_r -C buildop -H buildop -O buildop -W buildop  buildop/Kirti_Test.opd

##E IIS-DSEE-TBLD-00076 Subprocess command failed with exit status 256.
##W IIS-DSEE-TBLD-00000 Output from subprocess: "Pre-Loop Code (buildop/Kirti_Test.opd)", line 25.13: 1540-0211 (S) The array operator must have one operand that is a pointer to a complete type and an operand that is of integral type.

##I IIS-DSEE-TBLD-00079 /usr/vacpp/bin/xlC_r   -O   -I/IVDS20/IIS/IBM/InformationServer/Server/Projects/dsp_rcdr/buildop -I/IVDS20/IIS/IBM/InformationServer/Server/PXEngine/include -O -q64 -c /IVDS20/IIS/IBM/InformationServer/Server/Projects/dsp_rcdr/buildop/bosource53805814-0.C -o /tmp/bosource53805814-0_s.o.
If I remove the statement LenLKP_KEY[0] = 0;, compilation works. But with it, the compilation fails with the above error.

I tried writing simple C program that uses the above array and compiled it using the same compiler used in DS. It is working fine.

Any inputs?

Posted: Wed Oct 12, 2011 10:48 pm
by Kirtikumar
After trying out few things, I was able to locate the issue. The input metadata column name was same as the variable and so error was reported.

Once the variable name was changed to make sure it is not same as the metadata, the issue was resolved.

Posted: Wed Oct 12, 2011 11:55 pm
by ray.wurlod
Well done on finding that; the error message was singularly unhelpful if that was indeed the cause.

Perhaps you could mark the thread as Resolved.