BuildOp: Compilation failing with Array

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
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

BuildOp: Compilation failing with Array

Post 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?
Regards,
S. Kirtikumar.
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post 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.
Regards,
S. Kirtikumar.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply