The ACCEPT
keyword does no editing or error checking of the data it stores, therefore its use can be dangerous. For this reason,
ACCEPT
should be avoided.
Noncompliant code example
01 USER-INPUT PIC X(4).
GET-USER-INPUT.
MOVE 'N' TO WS-NUMERIC.
PERFORM UNTIL WS-NUMERIC = 'Y'
DISPLAY 'ENTER YOUR 4 DIGIT RECORD NUMBER: ' NO ADVANCING
ACCEPT USER-RECORD *> Noncompliant
Exceptions
This rule ignores uses of ACCEPT FROM
with date/time-related inputs.