I have observed a "new to me" issue in RPG. I first observed it in RPG IV and thought it was a bug in the compiler, but RPGIII does the identical thing. After talking with the IBM Canada RPG IV developers, the speculation is that it is a PRINTER file issue. Here's the summary:
When multiple fields (5 in our example) are output using Output Specs in RPG to a PRINTER file, such as QPRINT, if all 5 fields have data or blanks in them, the output is as expected.
However, if field 3 contains all X'00' characters then the output that is produced is shifted to the left. That is field's 4 and 5 are shifted to the left on top of field 3, beginning with position 2 of field 3.
*... v ...1 ...|... 2 ...v... ! ...v... 4 .!.v... ! ...v... 6 !..v... 7 Hello World My Name is Bob Cozzi from Chicago IL
Note that I inserted bars above each field's start position as a "field marker".
*... v ...1 ...|... 2 ...v... ! ...v... 4 .!.v... ! ...v... 6 !..v... 7 Hello World My Name is from Chicago IL
Note that the values "from Chicago" and "IL" have been shifted to the left over top of the NAME field's positions in the output line. They are actually overlaying position 2 of the name field. My assumption is that PRINTER support is looking at "null terminators" (a C language term) and causing this type of screw up.
Too bad we no longer have access to a real AS/400 (CISC processor) to see if the old compilers actually did the same thing. Because without proof that it is a bug, it will no doubt become a "feature".