View previous topic :: View next topic
|
Author |
Message |
atulrukmangad
New User
Joined: 10 Apr 2006 Posts: 13
|
|
|
|
What is the difference b/w following 2 codes
READ PRODUCT WITH PRODUCT-CODE
IF PRODUCT-CODE NE '1000'
ESCAPE TOP
END-IF
<expressions>
END-READ
READ PRODUCT WITH PRODUCT-CODE
ACCEPT IF PRODUCT-CODE EQ '1000'
<expressions>
END-READ |
|
Back to top |
|
|
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Hi:
Below 2 code block read scan thru a view. The significance in 2nd code block (ACCEPT statement) is it is used with a SORT statement. Where records those satisfy the condition after ACCEPT keyword will be taken for SORTing.
ACCEPT/REJECT keywords are used in conjustion with SORT statement.
READ PRODUCT WITH PRODUCT-CODE
IF PRODUCT-CODE NE '1000'
ESCAPE TOP
END-IF
<expressions>
END-READ
READ PRODUCT WITH PRODUCT-CODE
ACCEPT IF PRODUCT-CODE EQ '1000'
<expressions>
END-READ[/quote] |
|
Back to top |
|
|
naveen_desireddy
New User
Joined: 29 Aug 2005 Posts: 10 Location: Hyderabad, India
|
|
|
|
if records exist with EMPLOY-ID = '3' within the first 10 READS, then they will be written because:
"If an ACCEPT condition is satisfied, the record will be accepted and consecutive ACCEPT/REJECT statements will be ignored." |
|
Back to top |
|
|
vasanthanc
New User
Joined: 01 Apr 2005 Posts: 58
|
|
|
|
Quote: |
What is the difference b/w following 2 codes |
Both the code will give same result. No difference at all. As far as adabas is concerned, both the code will retrieve all records after that the condition will be checked and rejected based on that. So efficieny wise also both are same |
|
Back to top |
|
|
|