Hi,
I have a task to design a grouping rule engine that must be robust and flexible for future needs.
I have a customer file with relationship code and I need to group the customers according to group types. Each group type have different criteria.
For example:
1) Group Type ABC - extract based on (1) relationship codes (from FILE2) A1, A2, A3, (A4 and FILE2/X1 field > 10%). (2) For individual (from FILE2) excluding A2, include members B1, B2, B3 (3) Stop extracting members for B1, B2, B3 i.e. just extract members for A1, A2, A3, A4
2) Group Type DEF, extract based on (1) relationship codes B1, B2, B3 (2) based on members extracted in (1) extract the rest of the members by D1, D2, D3, (D4 and X1 field > 50% or X1 field >=20% and < 50)
Any idea how to parameterized the above so that I can build a grouping rule engine without any hardcoding in my programs? ALso, if in the future they want to include new file and fields in the extraction how to cater?
Thanks so much in advance for those who will reply to may question.
Software/Hardware used:
AS400 RPGLE
ASKED:
February 11, 2011 7:51 AM
UPDATED:
February 15, 2011 3:18 PM
This should be doable. Can you be a little more specific?
Is this for a single program, or multiple?
Is it Batch or Interactive?
The reason I ask, is I generally setup tables to control something like this, and it usually is a header file table and a detail file that.
A single record in the header file might contain:
Group Code ABC
Description Level A Customers…
Start Date mm/dd/yyyy
End Date mm/dd/yyy
The Detail file would be a one to many relationsjip with the Header File
Group Code ABC
Relation Code A1
Inc/Omit I
Group Code ABC
Relation Code A2
Inc/Omit I
Group Code ABC
Relation Code B1
Inc/Omit O
Hi,
This is going to be an online message i.e. interactive.
Based on your recommendation of creating a header and a detail file, what possible command I can use to do the extraction without hardcoding the filename and the fields?
I was thinking of using a dynamic SQL but the processing might take time considering that it is going to be an online message.
Also, by using these 2 files, how do I setup a table if I have further selection for each relationship codes?
Thanks so much in advance.
This is going to be an online message i.e. interactive.
Exactly what will be “an online message”? I’m not quite seeing how that ties back to these phrases:
“…group the customers according to group types…” and “…extract based on…” and “Stop extracting members…”
Can you clarify any more?
Tom