Ralph Zbrog
New User
Joined: 21 Nov 2009 Posts: 58 Location: California
|
|
|
|
If this is the only condition to be tested, then you must retrieve every record in the file and apply the condition.
Code: |
READ file PHYSICAL
IF field-name <> 'value'
THEN
ESCAPE TOP
END-IF |
Code: |
READ file PHYSICAL
ACCEPT IF field-name = 'value' |
Code: |
READ file PHYSICAL
WHERE field-name = 'value' |
WHERE is more efficient than ACCEPT which is more efficient than IF.
If your DBA allows it (highly unlikely - I wouldn't recommend it), the field could be defined in the DDM for non-descriptor searches. In this case Adabas would read every record in the file, but return only those that satisfy the condition.
Code: |
READ file BY field-name FROM 'value' TO value'
|
The best scenario would see a descriptor range narrow the number of records to be retrieved, then apply the condition.
Code: |
READ file BY de FROM 'RALPH' TO 'ZBROG'
WHERE field-name = 'value' |
Code: |
FIND file WITH de = 'RALPH' THRU 'ZBROG'
WHERE field-name = 'value' |
|
|