On Wed, May 31, 2017 at 12:41 PM, Farley, Peter x23353 < [email protected]> wrote:
> Apologies, the Z literal constant was indeed what I mis-remembered as a > PICTURE type. The Z picture type is for zero-suppression of a numeric > field and has no relation to the Z literal constant. > > Sorry for my confusion. > > Peter > It's easy to do. And I'm waiting for some COBOL programmer to ask why the following doesn't work: 77 SOME-VAR PIC X(5). MOVE Z'HELLO' TO SOME-VAR. In COBOL 4.2, there is no error. Not even a warning (unless I've missed a compile option). But the trailing x'00' is quietly truncated. And so if the variable is passed to a C routine as a "char *", you are in a world of hurt. -- Windows. A funny name for a operating system that doesn't let you see anything. Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
