I'm trying to write a buildop for the following requirement........I have an input stream which has 2 columns
ProdID
ProdName
and I also have a rules reference table which has
ColumnNumber
Trigger
Value
suppose the rules reference table has values
colNum , Trigger , Value
1 , 2345 , 4567
2 , Marlboro , Marl Lights
For each and every record in the input stream......
The ProdID should take 4567 if its equal to 2345
and ProdName should take Marl Lights if it is equal to Marlboro....
I put together the following code for the buildop.......
Code: Select all
#include <string.h>
#include <stdio.h>
APT_String V_ProdID;
APT_String V_ProdName;
readRecord(0);
readRecord(1);
while (!inputDone(0))
{
V_ProdID = S1.ProdID;
V_ProdName = S1.ProdName;
while (!inputDone(1))
{
if (L1.ColumnNumber==1)
{
if (L1.Trigger==S1.ProdID)
V_ProdID = L1.Value;
}
else if (L1.ColumnNumber==2)
{
if (L1.Trigger==S1.ProdName)
V_ProdName = L1.Value;
}
readRecord(1);
}
Output.ProdID = V_ProdID;
Output.ProdName = V_ProdName;
transferAndWriteRecord(0);
readRecord(0);
readRecord(1);
}
endLoop();
The logic works only for the first record.......cos the second while loop in the code executes only once.......Is there a way to make the second loop run for each and every input record??????........
we are using DS 7.5.1A...........I welcome suggestions for doing outside of the buildop too......
Appreciate the help...
Thanks
PJSimon.