Focal Point
[SOLVED] Function in maintain

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9097074906

September 09, 2011, 01:33 AM
Shankar
[SOLVED] Function in maintain
Is ther any function available in maintain to find whether a number is divisible by 10 or not?I want to put it in conditional clause along with some other conditions also using AND operator.I am using INT (number) alongwith one more condition using AND but it is throwing "(FOC03636) 'Lazy' AND : Is Unsupported Syntax." Can anybody help please?

Thanks in advance.

This message has been edited. Last edited by: Kerry,


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
September 09, 2011, 04:12 AM
Alan B
Shankar

I don't know why you would be getting a 'lazy and' error, but it is simple to avoid.

Something based on this example may help:
MAINTAIN FILE car

Declare divisible/a0;

Case top
  for all next country car model bodytype into carStack;

  Repeat carStack.focCount i/i4 = 1;

$$ make ENGLAND sales non-divisble by 10 
    carStack(i).sales = if  carStack(i).country eq 'ENGLAND'
                        and carStack(i).sales ne 0 
                           then carStack(i).sales + 5 
                           else carStack(i).sales;

$$ check divisibilty by 10 as long as non-zero
    divisible = if  (INT(carStack(i).sales/10) eq carStack(i).sales/10) 
                and carStack(i).sales ne 0 
                   then 'Divisible' 
                   else 'Non-Divisible';

  type "<carStack(i).sales  <divisible";

endrepeat i = i + 1;
EndCase
END



Alan.
WF 7.705/8.007
September 12, 2011, 12:37 AM
Shankar
Thanks a lot.It worked.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
September 12, 2011, 01:47 PM
j.gross
Doesn't Maintain support the MOD (or IMOD) function?