Accept and Reject statement in natural



Software AG's platform-independent programming language with full support for open-source and Internet applications

Accept and Reject statement in natural

Postby diptisaini » Tue Nov 23, 2010 1:16 pm

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 ?
diptisaini
 
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Accept and Reject statement in natural

Postby dick scherrer » Wed Nov 24, 2010 3:00 am

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Accept and Reject statement in natural

Postby RGZbrog » Wed Nov 24, 2010 11:20 pm

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.
User avatar
RGZbrog
 
Posts: 101
Joined: Mon Nov 23, 2009 1:34 pm
Location: California, USA
Has thanked: 0 time
Been thanked: 0 time

Re: Accept and Reject statement in natural

Postby dick scherrer » Thu Nov 25, 2010 3:06 am

Thanks for the clarification :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Accept and Reject statement in natural

Postby RGZbrog » Fri Nov 26, 2010 12:51 am

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"
User avatar
RGZbrog
 
Posts: 101
Joined: Mon Nov 23, 2009 1:34 pm
Location: California, USA
Has thanked: 0 time
Been thanked: 0 time

Re: Accept and Reject statement in natural

Postby prabu » Fri Dec 17, 2010 7:19 am

It is a nice information.........
prabu
 
Posts: 2
Joined: Fri Dec 17, 2010 7:17 am
Has thanked: 0 time
Been thanked: 0 time

Re: Accept and Reject statement in natural

Postby fidelis » Fri Dec 17, 2010 4:41 pm

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.
fidelis
 
Posts: 7
Joined: Thu Dec 16, 2010 1:01 am
Location: Brazil
Has thanked: 0 time
Been thanked: 0 time


Return to Natural

 


  • Related topics
    Replies
    Views
    Last post