View previous topic :: View next topic
|
Author |
Message |
purushottam
New User
Joined: 26 Feb 2007 Posts: 37 Location: pune
|
|
|
|
To speed up the process I am planning to use the super descriptor in READ/FIND statement.
Super descriptor ===>> NUM-LOC-STUS-ITEM-TYPE (A15)
which consist of
NUM ( N9)
LOC (A4)
STATUS (A1)
ITEM-TYPE (A1)
Here I want to read the record only if it satisfy the condition like
NUM = 123456789 -555555555 (Entire range) ===>> Here I can use Starting From
LOC = 9999
STATUS = A
ITEM-TYPE = A OR B OR C (means more than one value) ==>> Here I need help
I want to use above all 4 conditions in READ loop only (No IF check's) Can any one please guide me how to do it in NATURAL |
|
Back to top |
|
|
beruoist
New User
Joined: 14 Nov 2007 Posts: 70 Location: mumbai
|
|
|
|
Why do you not want to club if with the read/find...because it will be the easiest way to perform this.
Do you think there is any other way...of doing this other than if ?
Pls Share
Regards
Beruoist |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
If the values of ITEM-TYPE are consecutive (like A-D, G-Z etc.), then you can use STARTING FROM - ENDING AT clauses. If not, you might want to consider ACCEPT/REJECT statements.
O. |
|
Back to top |
|
|
purushottam
New User
Joined: 26 Feb 2007 Posts: 37 Location: pune
|
|
|
|
Thanks for your reply...
The values of ITEM-TYPE are not consecutive values are 'L' OR 'R' OR 'Y' OR '6' OR '8' OR '9', also i found in manuals that ACCEPT/REJECT criterion is evaluated after the record has been selected/read. So i am not sure whether it is equvalent to IF condition (time taken to complete the process will be the same) ???
If no other ways then i would opt for 4 seprate read/find loops. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
From the logic point of view - ACCEPT/REJECT are exactly like IF. From the performance point of view - ACCEPT/REJECT are slightly more efficient then IF, as Natural processes the record internally without waiting for IF. In any case, for huge file processing, it is not recommended to use ACCEPT/REJECT, and separate READs are a totally accepted solution.
O. |
|
Back to top |
|
|
|