X PROG 759: Invalid structured field length
X PROG 759 means a Write Structured Field command contained a structured field with an invalid length. The closely related X PROG 760 means a structured field had reserved fields that weren't zero. In both cases the terminal rejected the command and locked the keyboard.
Other names for this code
Also written as PROG 759, PROG759, X PROG 759, PROG 760, PROG760, X PROG 760, 3270 PROG 759, 3270 PROG 760, structured field length error, reserved field not zero 3270.
What it means
Write Structured Field (WSF) is the 3270 command for anything more complex than painting a screen. Behind the command comes one or more structured fields. Each one starts with a two-byte length, then an ID that says what kind of field it is, then its data. Common outbound structured fields include Read Partition (used to query the terminal), Erase/Reset, Set Reply Mode, Load Programmed Symbols and Outbound 3270DS, which carries an ordinary screen write inside a structured field.
The length is how the terminal finds where one structured field ends and the next begins. It counts the whole field, including the two length bytes themselves. A length of zero is allowed only for the last structured field and means it runs to the end of the data. A length that is too short to hold the field's required parts, or longer than the data that is left, can't be correct. The terminal then reports X PROG 759.
Many structured fields also contain bytes or bits that the architecture marks as reserved. A terminal expects them to be zero. If a reserved byte or bit is set, it reports X PROG 760. That is a sign that the field was built from the wrong layout, or that the host is using a later or different definition of the field than the terminal knows.
Both codes point at the program that built the structured fields, not at the operator.
Common causes
- The program wrote the length without counting the two length bytes, or counted them twice (PROG 759).
- The program used a length of zero on a structured field that wasn't the last one in the command (PROG 759).
- The buffer was cut short when it was sent, so the last structured field's length points past the end of the data (PROG 759).
- The program built a structured field from an older or wrong layout, so data landed in reserved positions (PROG 760).
- Work areas weren't cleared before the structured field was built, so leftover bytes sit in reserved positions (PROG 760).
How to find the problem
- Take a data stream trace and find the WSF command (X'F3' or X'11'). Step through the structured fields one by one, using each length to find the next. The field where the lengths stop adding up is the bad one.
- For PROG 760, compare the bytes of each structured field with its layout in GA23-0059 and look for anything nonzero in a position marked reserved.
- Check the length the program passes on the send. If it is shorter than the data built, the last structured field arrives cut off.
- In CICS, applications that send structured fields themselves use
SENDwith the STRFIELD option. CEDF shows the data and length before it goes out.
How to fix it
- For the user, press Reset and Clear and retry. Report the function and time if it repeats.
- Set each structured field's length to the full size of the field, including the two length bytes.
- Use a zero length only on the last structured field, or avoid it and always give the real length.
- Clear the work area to binary zeros before building each structured field, so reserved bytes stay zero.
- Build fields from the current GA23-0059 layout, and check the Query Reply before using any field the terminal may not know.
Read this error in WND Terminal
For a visible X PROG 759 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
Does the structured field length include the length bytes?
Yes. The two-byte length counts the whole structured field, length bytes included.
Why are PROG 759 and PROG 760 on one page?
Both mean a structured field was built wrong. One has a bad length and the other has reserved bytes that aren't zero, and the way to find and fix them is the same.
Can the emulator be at fault?
It can, but it is less likely. If a trace shows correct lengths and zero reserved bytes, report it to the emulator vendor.