5250 error 0007: Mandatory enter field, data required
5250 error 0007 means you pressed Enter, or another key that sends the screen, while a mandatory-enter field still had nothing keyed into it. The display station holds the screen back and locks the keyboard until you type something there.
Other names for this code
Also written as 0007, error 0007, 5250 0007, operator error 0007, mandatory data entry field, mandatory enter field must enter data, AS/400 error 0007.
What it means
A programmer can mark an input field as mandatory enter. In DDS that is the keyword CHECK(ME), or CHGINPDFT(ME) at field, record or file level. The display station then insists that at least one character is keyed into the field before the screen goes back to the program. A blank counts as a character. The rule is about keying the field, not about what value ends up in it.
When you press Enter, the display station looks for any mandatory-enter field you haven't keyed. If it finds one, it doesn't send the screen. It locks the keyboard and shows 0007. The program never sees the attempt.
One detail confuses programmers. IBM's DDS reference says the display station doesn't enforce mandatory enter when nothing on the screen has been changed. A user who presses Enter on an untouched screen gets through, while a user who changed some other field first gets 0007. The same screen can seem to behave differently for different people.
Common causes
- The screen has a required field and you pressed Enter without typing in it.
- You changed another field on the screen. Once anything has changed, the display station enforces the mandatory-enter rule that it skips on an untouched screen.
- The field already showed a value written by the program, so it looked filled. Mandatory enter wants a keystroke in the field, and a value the program wrote there doesn't count.
- The display file has
CHGINPDFT(ME)at file or record level, which makes every input field in its scope mandatory enter, including fields nobody meant to require.
How to find the problem
- After Reset, look for the required fields on the screen. Many applications highlight them or mark them in the field labels. The first one you haven't keyed is the one holding up Enter.
- Press Help while 0007 is on the error line to see the system's text for the error.
- In the display file source, look for
CHECK(ME)on the field, and forCHGINPDFT(ME)at record or file level. An option indicator on CHECK(ME) means the field is mandatory only when that indicator is on.
How to fix it
- Press Reset (also called Error Reset) to free the keyboard. In many PC emulators Reset is the left Ctrl key by default. Type a value in the required field and press Enter again.
- If the field already shows the right value, retype one character of it so the display station counts the field as keyed.
- If there is no value to give and the application accepts blanks, typing a space satisfies the display station, because a blank counts as entered data. The program may still reject the blank afterwards.
- For programmers, use
CHECK(ME)only where a keystroke is truly required. If you need a real value, check it in the program or withVALUES,RANGEorCOMPand send a message, since mandatory enter accepts a blank. - For programmers, to have mandatory enter enforced even when users press Enter on an untouched screen, IBM's DDS reference suggests
DSPATR(MDT)on at least one field in each record, so a change is always present. The check then applies to the other fields in the record. The display station can't tell whether a field with both DSPATR(MDT) and CHECK(ME) was keyed, so IBM suggests making such a field nondisplay withDSPATR(ND).
Read this error in WND Terminal
For a visible 5250 error 0007 message, Explain this screen can help interpret the screen under IT’s configured AI policy. It does not establish the cause of a rejected host data stream. Preserve the exact status and follow the diagnostic steps in this article.
Try the WND Terminal sample with fictional data · 3270 emulator features and installation · 5250 emulator for IBM i
IBM documentation
IBM Personal Communications documentation. Use the documentation for your installed release.
This link opens the relevant IBM reference library or lookup instructions. Match the complete code and your installed product release; it is not a code-specific review.
Related codes
Questions
Why does Enter work on one screen and give 0007 on another with the same empty field?
The display station enforces mandatory enter only when at least one field on the screen has been changed. If you changed nothing, Enter goes through. Programmers can force the check by setting DSPATR(MDT) on a field in the record.
Is 0007 the same as 0021?
Both come from a mandatory-enter field. 0007 appears when you press Enter with the field still not keyed. 0021 appears when you try to exit the field itself, for example with Field Exit, before typing anything in it.
Does a space count as data?
Yes. For the display station a blank is a keyed character, so typing a space clears 0007. The program can still refuse the blank value afterwards.