Page 1 of 1

Build Operator Example Per Record Tab

Posted: Mon Aug 20, 2012 8:35 pm
by darrreever
Hello DataStagers!

Would someone please post an example from their working Custom Stage (Build Type) Build tab> Logic> Definitions and Per-Record sub tabs.

My objective is to use this stage and I cannot find a single example to determine syntax, usage, etc. All of the Advanced Developers Guides from 8.0 to 8.7 all have an "Example Build Stage" section that references "The following screen shots.." and not one actually has a screenshot of anything. :roll: Specifically I am looking for an equivalent to Step 5 mentioned in that documentation. Any insights would be appreciated.

Posted: Tue Aug 21, 2012 12:15 am
by ArndW
I have written some build-ops but I can't post customer code. What I can do is remove most of the operative code to give you an idea of what happens. In the code posted, the build-op does it's own record processing, i.e. it takes over from DataStage and does all reads and writes by itself; normally the per-record code only processes one record and puts it to the output link.

Code: Select all

/********************************************/
/* In0 - input stream, Out0 - output stream */
/********************************************/
for (;;){
   if ( ProcessGroupChange && RowNumber != 0) {
	/* Lots of code */
      if (!ErrorFound) {
         j = 0;
         for (i=0;i<RefRecords;i++){
            if (RefTable[i].HistAktion == "I" ) {
               j                     += 1;
               Out0.HIST_TIK          = RefTable[i].Schluessel; 
				/* more code */
               writeRecord(0); 
            }
         }
         if (DebugSwitch){
			/* more code */
         }
      }
   } /* end if Group change */

   if (!inputDone(0)){
		/* more code */
      readRecord(0);
      if (inputDone(0)) CurrentKey = "DummyValue"; else CurrentKey = In0.HIST_TIK;
   } else break; /* Leave main loop, since In0 has been read completely */
   RowNumber++;
} /* end of infinite for-loop */

Posted: Mon Oct 22, 2012 6:33 pm
by darrreever
Hello DataStagers!

Thank you ArndW for your info.

For those of you who want more info, the best insight that I can give is to read the Orchestrate 7.0 User Guide and the Orchestrate 7.0 Developer's Guide. Specifically, on page 14.29 of the user guide will give the information on the example.

I highly recommend reading the old Ascential Software/Torrent guides. They are very helpful in explaining the PXEngine and all of its features. I have noticed much of the DataStage 8.0 - 8.7 Parallel Advanced documentation is taken almost cut and paste from these guides without the very good graphics and notes from the original.

Once again, thanks for all your support!

God Bless!

Posted: Mon Oct 22, 2012 8:06 pm
by ray.wurlod
There are also good examples in the IBM training class Advanced DataStage.