Kbase 12863: SAMPLE CODE BREAK group LAST-OF : Using named buffer
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
SAMPLE CODE BREAK group LAST-OF : Using named buffer
/* This provides another example of using sorted
groups to do conditional processing.
The desired output in this example is:
Cust-Num Sales-rep
-------- ---------
1 BBB
2 BBB
3 SLS
4 SLS
5 BBB
6 BBB
*/
DEFINE BUFFER buf-cust FOR customer.
for each customer no-lock
break by customer.cust-num by customer.sales-rep:
display customer.cust-num customer.sales-rep .
find buf-cust where
buf-cust.cust-num = customer.cust-num no-lock no-error.
IF NOT LAST(customer.sales-rep) THEN
DO:
find next buf-cust no-lock no-error.
IF buf-cust.sales-rep <> customer.sales-rep THEN DOWN 1.
END.
END.
Progress Software Technical Support Note # 12863