"Measuring diferrences between WHERE and ACCEPT"

Hi guys,

I need some help in the next topic: How do I measure the NATURAL behavior between two programs, the first one using the WHERE clause, against another using the ACCEPT statement ?

The rest of both programs are identical…

Please, let me know if exist any SAG product that satisfy the requirement…

Thanks a lot.

Here is a timing program and output

DEFINE DATA LOCAL
1 MYVIEW VIEW OF EMPLOYEES
2 NAME
1 #NUM (P3)
1 #COUNTER (P5)
1 #CPU-START (P9)
1 #CPU-END (P9)
1 #CPU-ELAPSED (P9)
END-DEFINE
*
INCLUDE AATITLER
INCLUDE AASETC
*
MOVE *CPU-TIME TO #CPU-START
STARTA. SETTIME
READR. READ MYVIEW WHERE NAME = ‘XX’
IGNORE
END-READ
WRITE 5T ‘WHERE TIME: ’ *TIMD (STARTA.)
COMPUTE #CPU-ELAPSED = CPU-TIME - #CPU-START
WRITE 5T ‘ELAPSED CPU TIME’ #CPU-ELAPSED // 5T '
’ (45)


MOVE *CPU-TIME TO #CPU-START
STARTB. SETTIME
READR2. READ MYVIEW
*
ACCEPT IF NAME = ‘XX’
IGNORE

END-READ
WRITE // 5T ‘ACCEPT TIME ’ *TIMD (STARTB.)
COMPUTE #CPU-ELAPSED = CPU-TIME - #CPU-START
WRITE 5T ‘ELAPSED CPU TIME’ #CPU-ELAPSED // 5T '
’ (45)

END

PAGE #   1                    DATE:    Oct 17, 2007
PROGRAM: WHERE01              LIBRARY: BOST-SIX

WHERE TIME:         1
ELAPSED CPU TIME          5

*********************************************


ACCEPT TIME         1
ELAPSED CPU TIME          7

*********************************************

Basically what this shows is that the difference is probably the “overhead” of entering the READ loop. Actually, it does not “show” it. I should have written out *COUNTER after each loop.

steve