Terminal screen error

5250 error 0020: Enter key not allowed in field

5250 error 0020 means you pressed Enter after typing in a right-adjusted or signed numeric field without leaving the field first. Press Field Exit, Field+ or Field- to finish the field, then press Enter.

Other names for this code

Also written as 0020, error 0020, 5250 0020, operator error 0020, enter key not allowed in field, field exit before enter, AS/400 error 0020.

What it means

Some fields are right-adjusted. The digits you type start at the left of the field, and the display station moves them to the right end when you finish. Signed numeric fields (shift S in the DDS) work this way by default, with blank fill. Other fields get it from CHECK(RB) or CHECK(RZ), or the matching AUTO(RAB) and AUTO(RAZ), which fill the left side with blanks or zeros.

IBM's DDS reference says the adjustment happens only when you press Field Exit, Field+ or Field-. Type 25 in a five-position quantity field and press Enter at once, and the field still holds 25 followed by three blanks, which isn't the number you meant. So the display station refuses Enter, locks the keyboard and shows 0020. The cursor stays where it was.

For a signed numeric field, IBM notes that Enter is fine if you typed nothing in the field. The error comes only once you have keyed digits and haven't finished the field.

Common causes

  • You typed a number in a quantity or amount field and pressed Enter without Field Exit.
  • Your emulator maps Enter and Field Exit to different keys than the terminal or emulator you are used to, so the key you think of as Field Exit sends Enter.
  • The field doesn't look numeric. A document or reference number with CHECK(RZ) behaves the same way, because it also right-adjusts.

How to find the problem

  1. Look at the cursor. It is still in the field you typed in, and the value hasn't moved to the right.
  2. Press Help while 0020 is on the error line to see the system's text for the error.
  3. In the display file source, check the field for shift S in position 35, CHECK(RB), CHECK(RZ), AUTO(RAB) or AUTO(RAZ).

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. Then press Field Exit (or Field- for a negative value) and press Enter.
  • Make Field Exit a habit after every number. Which key sends it depends on your emulator's keyboard map.
  • Check the emulator's keyboard map if 0020 keeps appearing. Most emulators let you choose which key sends Enter and which sends Field Exit.
  • For programmers, if right adjustment doesn't matter for a field, IBM's DDS reference says a numeric-only field (shift Y) without CHECK(RB) or CHECK(RZ) can be left with any key. Recreate the display file with CRTDSPF after the change.
  • For programmers, keep CHECK(RB) or CHECK(RZ) where the value must be aligned, for example key fields that are compared or zero-padded codes, and tell users to finish those fields with Field Exit.

Read this error in WND Terminal

For a visible 5250 error 0020 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.

Report a correction to WND Software.

Questions

Why do I have to press Field Exit before Enter on IBM i?

The field is right-adjusted, and the adjustment happens only on Field Exit, Field+ or Field-. Enter would send the digits unaligned, so the display station refuses it with 0020.

What is the difference between Field Exit, Field+ and Field-?

All three leave the field and right-adjust it. In a signed numeric field Field- marks the value negative, while Field+ and Field Exit leave it positive.

Is 0020 the same as 0018?

No. 0020 means Enter was pressed before leaving a right-adjusted field. 0018 means a data key was pressed at the end of a field that has to be left with a field exit key.