5250 error 0004: Typing not allowed in this field
5250 error 0004 means you typed into an input field that doesn't accept data from the keyboard. The field is defined to take its data from an attached feature device such as a light pen, so the display station rejects the key and locks the keyboard.
Other names for this code
Also written as 0004, error 0004, 5250 0004, operator error 0004, entry of data not allowed in this input/output field, AS/400 error 0004.
What it means
Not every input field is meant for typing. In DDS a programmer can give a field the keyboard shift I, which means inhibit keyboard entry, in position 35. The field is still input-capable, but its data is supposed to come from a device attached to the display station, such as a selector light pen. IBM's 5291 operator guide calls it an I/O feature field. When you press a character key in a field like that, the display station refuses it, locks the keyboard and shows 0004.
Some keys still work in an I field. IBM's DDS reference lists Field Advance, Field+, Field Exit and Dup as allowed, so you can move past the field or, where the program allows it, repeat the previous value. Typed characters are refused.
Few 5250 users have light pens or other feature devices today. So when 0004 shows up now, the likely cause is an old screen kept a field definition from the days when the hardware was there, or a programmer used shift I to stop typing when a protected field was what they meant.
Common causes
- The field has keyboard shift I in the display file, and you tried to type into it. It expects input from a light pen or another feature device.
- An older application was written for terminals that had feature devices attached. The devices are gone but the field definition stayed.
- A programmer used shift I to stop people typing in a field. Output-only usage or
DSPATR(PR)would have done that job without the error.
How to find the problem
- Check that the cursor really is in an input field. If plain letters or digits cause 0004 there, the field is inhibited for keyboard entry. If the cursor were outside every input field you would get 0005 instead.
- Press Help while 0004 is on the error line to see the system's description of the error.
- Open the display file source, for example the member in QDDSSRC, in RDi or SEU. An I in position 35 on the field's line marks it as inhibit keyboard entry.
- Ask whoever maintains the application whether the screen was built for a light pen or other feature device. That tells you whether the field is still meant to work that way.
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 Tab to move past the field, or use the device the field was built for.
- If the terminal still has the feature device the field was built for, use it to enter the data instead of typing.
- For programmers, if people need to type the value, change position 35 to A or to the shift that fits the data, and recreate the display file with CRTDSPF. If the change alters the record format level, recompile the programs that use the file, or they will stop with a level check (CPF4131).
- For programmers, if the aim is only to stop typing, use usage O for an output-only field, or keep usage B and add
DSPATR(PR). Users then get the familiar protected-field behavior.
Read this error in WND Terminal
For a visible 5250 error 0004 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
What is an I field on a 5250 screen?
It is an input field with the inhibit keyboard entry shift. It accepts data from a feature device such as a light pen, but not from the keyboard.
Is 0004 a fault with my keyboard?
No. The keyboard works. The field definition tells the display station not to accept typed data in that one field.
Can I still leave the field?
Yes. After Reset, Field Exit, Field+, Field Advance and Tab all move you on. Only typed characters are refused.