![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
The correct syntax is much like that in Basic programming, and the logical test(s) you have in the correlative is incomplete A;IF N(PRODUCT.MODEL)='A' 'B' 'C' 'D' THEN '1' ELSE '2' What you have to write is something like A;IF N(PRODUCT.MODEL)='A' OR N(PRODUCT.MODEL)='B' OR N(PRODUCT.MODEL)='C' ' OR N(PRODUCT.MODEL)=D' THEN '1' ELSE '2' Yes, I know what you're thinking, but that's what you have to do if you want it to work. Regards Malcolm Bull |
#3
| |||
| |||
|
|
MBTraining (AT) aol (DOT) com wrote: The correct syntax is much like that in Basic programming, and the logical test(s) you have in the correlative is incomplete A;IF N(PRODUCT.MODEL)='A' 'B' 'C' 'D' THEN '1' ELSE '2' What you have to write is something like A;IF N(PRODUCT.MODEL)='A' OR N(PRODUCT.MODEL)='B' OR N(PRODUCT.MODEL)='C' ' OR N(PRODUCT.MODEL)=D' THEN '1' ELSE '2' Yes, I know what you're thinking, but that's what you have to do if you want it to work. Regards Malcolm Bull That's fine - and will work (if the typo with one of the quote marks being in the wrong place is fixed) - but it is a bit long-winded and not so easy to change if the requirements change. A better idea might be to use a control file keyed on "product model" with a single attribute of manager:- CREATE-FILE PRODUCT.MODELS 1 1 Then, just to make things neat and tidy, create a dictionary item MANAGER:- ED DICT PRODUCT.MODELS MANAGER 001 A 002 1 003 Manager]Code 004 005 006 007 008 009 L 010 7 You might also like to create a MANAGERS file so that, if the people responsible for the PRODUCT.MODELS get promoted or something and someones else takes over their role, you can just change their name: CREATE-FILE PRODUCT.MODEL.MANAGERS 1 1 ED DICT PRODUCT.MODEL.MANAGERS NAME 001 A 002 1 003 Name 004 005 006 007 008 009 T 010 30 Then populate the files. Create an item in PRODUCT.MODEL.MANAGERS for each manager with their name in attribute 1, keyed on "1" and "2" for example. Create an item in PRODUCT.MODELS for each model with the number, or item-id, of each PRODUCT.MODEL.MANAGER in attribute 1, keyed on PRODUCT.MODEL. Finally, with these files in place, your "synonym" would simply do a Tfile translate to find the manager for each model:- A;N(PRODUCT.MODEL)(TPRODUCT.MODELS;X;;1) If you want to show the managers' names on a report, the synonym would be:- A;N(PRODUCT.MODEL)(TPRODUCT.MODELS;X;;1)(TPRODUCT. MODEL.MANAGERS;X;;1) If responsibility for a PRODUCT.MODEL changes from one manager to another, you simply change the manager code in the relevant PRODUCT.MODELS item. If a manager is replaced, you simply change the manager's name in PRODUCT.MODELS.MANAGER. No need to change the "synonym". Hth, Mike. |
#4
| |||
| |||
|
|
MNGR 001 S 002 0 003 MNGR 004 005 006 007 008 A;IF N(PRODUCT.MODEL)='A' 'B' 'C' 'D' THEN '1' ELSE '2' 009 L 010 4 |
![]() |
| Thread Tools | |
| Display Modes | |
| |