we want to do some patteren matching with a look up file(with 800 rows) and reject the data which does not match the criteria . It will not be a straight match up and so I have created a parallel routine .So basically I am taking the input and comparing the values against a look up file .But this is working only when the look up file has one record only. I am not sure why it is not working when theere are multiple values (rows) in the lookup file .
Your routine returns after comparing to the first lookup record, whether or not you get a match. You can simply change the while condition to include "&& flag == 0", remove the returns from the loop and place a return after the fclose statement.
How many rows of data will you be processing? Why not do this in a buildop instead, where you could read the lookup table into an array rather than opening and reading it each and every time you call the routine?
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
Thank you so much.I have changed it and it is working now . I am processing 80 records in the lookup table . I have never used a array before and thought this way would be better .
Not sure if I can ask , but Do you have any sample program which loops through an array.
I am sorry , just now learning the parallel routine and worked for a simple one .May be some silly questions , but want to take the expertise.
can i invoke multiple parallel routines in a single transformer ?cause for some reason only one routine is working for me in that case .Did i miss anything ?
Can i invoke multiple routines in a single Parallel routine , as it don't have a mian , not sure how to invoke like that ?
There are plenty of examples for looping in C and C++ available on the web. In fact, you are already using one method in your routine--the while loop. There are others: until is a variation on while, and for is used quite often as well.
You can call as many routines as you feel necessary inside a transformer, and they can either be contained in one or more objects/libraries (the .o/.so/.a files) so long as each is given a unique name. You must create a separate definition in Designer for each routine, however. You will provide the name of the routine itself (the function name), as well as the name of the object/library it is contained in.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.