5250 error 0005: Cursor in protected area of display
5250 error 0005 means a key was typed while the cursor sat in a protected part of the screen, outside any input field. The display station refuses the character, locks the keyboard and shows 0005 until you press Reset.
Other names for this code
Also written as 0005, error 0005, 5250 0005, operator error 0005, cursor in protected area of display, AS/400 error 0005, IBM i keyboard locked 0005.
What it means
A 5250 screen is made of input fields and everything else. Headings, labels, output-only fields and empty space are protected. The display station accepts typed characters only inside input fields. When you press a character key with the cursor anywhere else, it doesn't pass the key on. It locks the keyboard itself and puts 0005 on the error line, which is usually the bottom row of the screen.
This check happens in the terminal or emulator, not on IBM i. The program never learns that a key was pressed, and nothing is written to the job log.
Usually the cause is simple. The cursor was left on a heading or between two fields, often after a mouse click or after the program redrew the screen. Sometimes the field you meant to type in is really an output field, because the program protected it for this record.
Common causes
- You clicked with the mouse or used the arrow keys, and the cursor ended up on a label, a heading or a blank area instead of inside an input field.
- The program redrew the screen and left the cursor outside any input field, for example on the title line or on the function key list.
- The field looks like an input field, but the program protected it for this record. Many programs protect the key fields of a record once it has been found, so you can see the value but not change it.
- On some lists (subfiles), the program protects the option column on rows where no option applies.
- You typed past the end of the last input field on the screen and kept going.
How to find the problem
- Look at where the cursor is. It sits just after the last character you typed. If it isn't inside an underlined or highlighted input field, that explains the error.
- Press Help while 0005 is showing. On a signed-on session the system shows a line of text that describes the error, so you can tell a protected-area error from a field rule.
- If you think the field should take input, check the display file source or ask the programmer. In DDS, an input field has I or B in the usage column (position 38). O means output only. The keyword
DSPATR(PR)protects an input-capable field, often under an indicator so it is protected only some of the time. - Don't look in DSPJOBLOG. The display station handled the error on its own, so the system has no record of it.
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 Tab or Field Exit to jump to the next input field and type again.
- Move between fields with Tab and Backtab (Shift+Tab) instead of clicking. They stop only in input fields, so you can't land on protected space.
- If the field is protected on purpose, the program usually offers another way to change it, such as a Change option or a function key. Check the key list at the bottom of the screen.
- For programmers, put the cursor where users will type.
DSPATR(PC)on a field, or theCSRLOCkeyword on the record format, sets the cursor position when the record is written. - For programmers, if users must be able to change a field, give it usage B and put
DSPATR(PR)under an indicator, so the program protects it only when it should.
Read this error in WND Terminal
For a visible 5250 error 0005 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 my keyboard lock when I type on an IBM i screen?
The display station locks the keyboard whenever a keystroke breaks a screen rule, and shows a four-digit code such as 0005 on the error line. Press Reset to free it, then deal with whatever the code points to.
Does 0005 mean my session is broken?
No. It only means the cursor wasn't in an input field when you typed. Press Reset and carry on. Nothing was sent to the system.
What is the difference between 0005 and 0004?
With 0005 the cursor is outside every input field. With 0004 the cursor is in an input field, but that field doesn't take typed data because it is meant for a feature device such as a light pen.