Guest
(Guest)
October 30, 2006, 2:25pm
1
I have something like that:
READ X BY KEY1
IF X.FIELD1 NE 3
ESCAPE BOTTOM
END-IF
*
…
END-READ
I get error 954 on line with: ’ IF X.FIELD1 NE 3’, FIELD1 is
member of KEY1. I need to bypass this i mean BAD record.
Could i correct this in that way:
READ X BY KEY1
IF X.FIELD1 NE 3
ESCAPE BOTTOM
END-IF
*
ON ERROR
IF ERROR-NR = 954
IGNORE / READ NEXT RECORD ?
END-IF
END-ERROR
*
…
END-READ
Would it be working and th next record will be read ?
Thanks in advance
Wilfried_B
(Wilfried B)
October 30, 2006, 2:37pm
2
If X.FIELD1 is not numeric, your IF-test will produce NAT954!
You first have to check, whether X.FIELD1 is numeric. See this thread . This addresses exactly your problem.
Guest
(Guest)
October 30, 2006, 3:21pm
3
So…FIELD1 is P2
IF FIELD1 = MASK (9Z)
/* field is numeric
ELSE
/* field is not numeric
END-IF
Is this good ?
Guest
(Guest)
October 30, 2006, 5:02pm
5
Thanks very much for YOUR help
Matthias1
(Matthias)
November 1, 2006, 11:00pm
6
By the way: I’ve often seen such a IGNORE-Construction in an ON ERROR block. But IGNORE is not a statement to leave an ON ERROR block. Valid statements are:
RETRY (only on NAT3145)
FETCH (not FETCH RETURN)
STOP
TERMINATE
ESCAPE ROUTINE
If none of these Statements are used, your program is stopped with an error message.
See the documenation for more details: http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat421mf/sm/onerror_0910.htm#syn_desc