Problem:
Trying to validate alphabetic characters in numeric fields (i.e to get rts error 163 returned) in an application that has the RM compiler directive set, the validation is not applied in all cases.
Even with the COBSW= F environment variable set to force the validation it doesn't work.
Resolution:
Take the following code:
$SET RM
Working-storage section.
01 numerica pic 9(3).
01 alfabetica pic x(3).
01 blank-field pic x(3).
procedure division.
move "AAA" to alfabetica
move alfabetica to numerica
display numerica
move numerica to blank-field.
stop run
In this example, with the F COBSW switch set (or running .int code which by default validates numeric data), error code 163 will NOT be returned when 1) the alphabetic data is moved to the numeric field or 2) when the numeric field is displayed.
However, it will return the error when the numeric field is manipulated in any way (eg MOVE or an arithmetic fuction such as ADD, SUBTRACT etc).
If the RM directive is removed from the program above, rts error code 163 will be returned on the move of the alpha data TO the numeric field - i.e. the data is checked before the move TO the numeric field is made. With the RM directive set this check does not take place.



