why is Display statement displaying in this way?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.  I'm new to this list, so hope my question(s) are no breach of any protocol.

I am a long time COBOL programmer, but just started using GNUCOBOL on my Linux Mint machine recently. This is a small thing, but it's got me puzzled! I have a few Display statements in the program I've been working on the last 2 days and they are displaying in a way I have NEVER seen a Cobol Display statement display before. EVERY display spills over onto a 2nd line. And it always spills over onto the 2nd line where a space appears in the record I am displaying. It is NOT a control character. I've done a hex dump to confirm that. It is always a space. But it could be the first space in the record, or the 2nd, or the 3rd, or the 4th, etc. And it displays sometimes just a few characters on the first line, sometimes quite a few more than that.  There doesn't seem to be any discernible pattern to when the display spills over onto the 2nd line.

Well, I finally figured out that the Display statement is using the defined maximum length (very long) of my variable length record rather then the actual length of the record (pretty short) (and which I've verified that it has correctly).  Why is this? Why doesn't the Display statement display the record only up to its known length?  Also, why is it displaying one piece of the actual record on one line, then displaying the rest of the actual record on the 2nd line? Why isn't it displaying the entire variable length record as is, with the actual content of the record first on the first line, then the rest of the long maximum length (filled with spaces) on subsequent lines?

If anyone has any insight into any if this, it would be much appreciated. (BTW, now that I've changed the definition of the record to be a much shorter maximum length, it displays just fine on one line.)

Thank you.

Rod





[Index of Archives]     [Gcc Help]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Info]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux