Buildop not outputting any rows

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
boxtoby
Premium Member
Premium Member
Posts: 138
Joined: Mon Mar 13, 2006 5:11 pm
Location: UK

Buildop not outputting any rows

Post by boxtoby »

Has anyone come across this problem?

I have created a simple buildop which looks for one character in another a string as a learning exercise. "1" is output when it finds the character and "0" when it doesn't, eg. 1 in 1234 gives "1"; 1 in 2345 gives "0".

The buildop compiles fine.

The source for the job is a simple text file, in to the buildop stage and out to another text file. Only the "1" or "0" is output, or should be.

The job compiles and runs fine, 4 records input but nothing output.

I dropped the two input columns from the output because the produced the warning message about columns with the same name.

The meta data in the repository is correct.

I have tried various setting with the auto read and write on Input/Output/Transfer tabs but nething makes any difference.

Any help would be appreaciated, here's the code in case it helps:


Definitions:

#define INPUT 0
#define OUTPUT 0

#include <string>

using namespace std;
size_t LenFld2 = 0;
APT_Int32 FoundPM = 0;
APT_Int32 int Loop = 1;

int Answer = 0;


Per Record:

LenFld2 = InRec.Field002.length();
FoundPM = 0;
Loop = 1;

while (Loop <= LenFld2)
{
if (InRec.Field002.substring(Loop,1) == InRec.Field001)
{
FoundPM = 1;
break;
}
else
Loop++;
}

OutRec.Answer = FoundPM;
writeRecord(OUTPUT)
Bob Oxtoby
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Buildop not outputting any rows

Post by sud »

Can you please try :

Code: Select all

transferAndWriteRecord(0)
instead of WriteRecord. The auto write and transfer settings should be false.

Also, mention the transfer settings you have chosen for this one.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
Post Reply