i just want to know how to make sure that the input entered by the user is only Y, y, N, or n.
I used this code:
01 ANSWER PIC X.
88 VALID-ANSWER VALUE "Y" "y" "N" "n".
But still it doesn't work. The user can still type other characters. Any help will be appreciated. Thanks in advance.
You just can't restrict the user input, except for uppercase. What you can do is this:
At Working-Storage:
At Procedure:
That will make sure whatever the user inputs, it's full uppercase. Then you check only for a "Y":
I hope it helps.