consoleconsole-applicationcobolgnucobol

Unwanted underscore using filler displaying from screen section


I am using GnuCobol for Win 10. When I use filler with spaces in a normal display the screen shows the spaces, but when I use filler in screen section I get unwanted underscores (_____). Is ther any way to get spaces instead underscores using screen section?

This is my example code:

   IDENTIFICATION DIVISION.
   PROGRAM-ID. FillerExample.
   DATA DIVISION.
   WORKING-STORAGE SECTION.
   01 record-example.
       05 FILLER PIC X(5) VALUE "     ".
   SCREEN SECTION.
   01 DISPL-SCREEN AUTO.
       05 LINE 02 COLUMN 20 using record-example.
   PROCEDURE DIVISION.
   Display-Fillers.
       DISPLAY DISPL-SCREEN
       STOP RUN.

I need get spaces in order to align some headers and labels in a console program using GnuCobol, I could use DISPLAY TITLE LINE X COL Y but is cumbersome to me.


Solution

  • using record-example effectively says "this is the input source data and the data input goes there as well" - it is just a field for input/output.

    For SCREEN SECTION: have separate fields and align them with COL + 5:

       SCREEN SECTION.
       01 DISPL-SCREEN AUTO.
           05 LINE 02 COLUMN 20 using field-1.
           05 COLUMN +5 using field-2.
           05 COLUMN +5 using field-3.