Screen section

“Redirection is not supported” error in COBOL compilers

“Redirection is not supported” is a common error in GnuCOBOL and OpenCOBOLIDE. It can occur when you try to run a program containing SCREEN SECTION in it.

redirection is not supported
redirection is not supported

 

Below is the program that i was trying to run.

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLOWORLD.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 RESPONSE-IN-WS PIC X(5).
SCREEN SECTION.
01 DATA-ENTRY-SCREEN.
    05 VALUE “MY FIRST SCREEN” BLANK SCREEN         LINE 1 COL 50.
    05 RESPONSE-INPUT                               LINE 14 COL 45
              PIC X(5) TO RESPONSE-IN-WS.
PROCEDURE DIVISION.
          DISPLAY DATA-ENTRY-SCREEN.
          ACCEPT DATA-ENTRY-SCREEN.
          STOP RUN.

The program contains a SCREEN SECTION.

To remove this error you can simply just edit an option in the preferences tab of the OpenCOBOLIDE.

  1. Go to Edit on the top left menu.
  2. Then click on Preferences.

In Preferences there is an option “Run in external terminal”. Check this option. You are good to go now.

Run in a separate terminal
Run in a separate terminal option

If i run my program now, then it will display the screen and wont show that error anymore.

Screen section
Screen section

 

Leave a Reply

avatar
  Subscribe  
Notify of