Hi Scott -
On Wed, 05 Dec 2012 07:54:51 -0500, Scott Coffey
<no...@noemail.com.invalid> wrote:
>The message ID is RPG1021 (duplicate key halt). I can see that the
>default reply is "C". I tried changing the default reply to *NONE,
>but it's still not giving me the results I want (so I changed it
>back).
>
>In this instance the user pressed enter on three different halts:
>
>RPG1021 - duplicate key halt. Pressed enter, default "C" was taken,
>RPG9001 received by CL program blah, blah. Pressed enter, default "C"
>was taken.
>CPF9999 received by CL program blah, blah. Pressed enter, default "C"
>was taken.
>
>I would prefer that pressing enter on these halts just asked the user
>to enter a correct response. Is that possible?
As a side note, ideally the program should handle a duplicate key
error if it is a situation that could be expected to ever occur. I.e.
two users attempting to add the same value to a master file at the
same time. The user should never see the system inquiry message.
However that's not always possible, especially if dealing with
third-party software.
Getting back to the specific question ...
I ran a test. With a default reply of *NONE, the operating system was
still happy to accept just the Enter key, and returned a null reply
(indicated on the screen by *N) to the program instead of the original
C default reply.
The RPG400 error handler appear to treat the null response the same as
a C response.
So it *appears* to not be possible to force the user to have to
actually key one of the valid responses.