Page 1 of 1

Accept and Reject statement in natural

PostPosted: Tue Nov 23, 2010 1:16 pm
by diptisaini
If the processing continues to the last ACCEPT/REJECT statement, the last statement will determine
whether the record is accepted or rejected.

I just need to know on what scenario above statement is true . Can anyone please explain me with example ?

Re: Accept and Reject statement in natural

PostPosted: Wed Nov 24, 2010 3:00 am
by dick scherrer
Hello,

I just need to know on what scenario above statement is true


First - i don't "do" Natural - but:
This behavior should be true all of the time. . .

Unless there is something i completely misunderstand. . .

Re: Accept and Reject statement in natural

PostPosted: Wed Nov 24, 2010 11:20 pm
by RGZbrog
If the processing continues to the last ACCEPT/REJECT statement, the last statement will determine whether the record is accepted or rejected.

Processing of individual ACCEPT/REJECT statements is straightforward, but Diptisaini's quote is from the manual section "Processing of Multiple ACCEPT/REJECT Statements."

A series of individual ACCEPT/REJECT statements (non-consecutive, separated by other statements) is treated like multiple logical criteria joined with ANDs, as you would expect. Contiguous/consecutive ACCEPT/REJECT statements are processed as though they were a single compound IF with the criteria separated with ORs.

ACCEPT IF  CITY   = 'Cairo'
ACCEPT IF  GENDER = 'M'
ACCEPT IF  AUTO   = 'Honda'

If the CITY field contains "Cairo", the record is accepted, and there is no need to test the GENDER and AUTO fields.
If the CITY is not Cairo, then the GENDER field is tested. If it contains "M", the record is accepted and the AUTO field is not tested.
If the first two criteria are false, then the record will be accepted or rejected based on the contents of the final criterion - the AUTO field.

Re: Accept and Reject statement in natural

PostPosted: Thu Nov 25, 2010 3:06 am
by dick scherrer
Thanks for the clarification :)

d

Re: Accept and Reject statement in natural

PostPosted: Fri Nov 26, 2010 12:51 am
by RGZbrog
Perhaps my previous post should have included this example.
ACCEPT IF  CITY   = 'Cairo'
WRITE 'Only Cairo records'
ACCEPT IF  GENDER = 'M'
WRITE 'Only Male/Cairo records'
ACCEPT IF  AUTO   = 'Honda'
WRITE 'All criteria are true'

Here, I appended a WRITE statement to the original example
ACCEPT IF  CITY   = 'Cairo'
ACCEPT IF  GENDER = 'M'
ACCEPT IF  AUTO   = 'Honda'
WRITE 'At least one criterion is true"

Re: Accept and Reject statement in natural

PostPosted: Fri Dec 17, 2010 7:19 am
by prabu
It is a nice information.........

Re: Accept and Reject statement in natural

PostPosted: Fri Dec 17, 2010 4:41 pm
by fidelis
It statements are used for admit to a group or no admit to a group of record. The logical criteria specified by the user will enable this.
The ACCEPT/REJECT statement will be used to processing loop (FIND, READ, HISTOGRAM, CALL FILE, SORT or READ WORK FILE). The processing will be done after the reading.