Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
What is purpose of Hit=NExt in IFthen |
It's easier to explain with an example:
Code: |
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),OVERLAY=(21:C'A')),
IFTHEN=(WHEN=(5,1,CH,EQ,C'1'),OVERLAY=(25:C'B'))
|
The above does NOT have HIT=NEXT, so when position 1 has '1', we put 'A' in position 21 and stop processing that record. We will not check if position 5 has '1' so we can only get 'A' or 'B', but not both.
Code: |
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),OVERLAY=(21:C'A'),
HIT=NEXT),
IFTHEN=(WHEN=(5,1,CH,EQ,C'1'),OVERLAY=(25:C'B'))
|
The above does have HIT=NEXT, so when position 1 has '1', we put 'A' in position 21 and then we check if position 5 has '1' and put a 'B' in position 25. Thus, with HIT=NEXT, we can get 'A' and 'B'.
HIT=NEXT is useful when the conditions of different clauses can be satisfied independently. It tells DFSORT to continue with the next clause even if the current clause is satisfied. |
|