Screen section

“Redirection is not supported” error in COBOL compilers

Why does the “Redirection is not supported” error occur?

“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. Below is a screenshot of the error in OpenCOBOLIDE.

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 that gave me “Redirection is not supported”

The program contains a SCREEN SECTION. So, if you try to run this program it will give you the error “Redirection is not supported”

Solution to this error

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.

Go to Preferences. There is an option called “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

If you want to learn COBOL programming then you can take an online course. I also have an Udemy course that may help you to learn COBOL using OpenCOBOLIDE. The course is over 19+ hours long and will teach you the whole Mainframe environment in detail. It will teach you all the major technologies that you will need to start a career in Mainframes such as COBOL, JCL, TSO/ISPF, VSAM and CICS. It also has an extra project related to Electronics where i will teach how you can install a Mainframe emulator on Raspberry Pi and use it to practice your Mainframe skill. You can find more details about the course in the Link here.

5 comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Get a FREE JCL Ebook