COBOL

 View Only

 Problems when using the COBCPYEXT and COBOPT environment variables

Eduardo Pozos Huerta's profile image
Eduardo Pozos Huerta posted Thu April 09, 2026 01:52 AM

When I try to use these variables, I simply can’t get them to work.

In my GnuMake file, I’ve entered the following:

export COBOPT:=-q64
export COBCPYEXT:=.cpy

In the case of COBOPT, I get an error saying it doesn’t recognise -64 as a command-line option, so I assume it’s ignoring the ‘q’.

The problem with COBCPYEXT is that when I enter COPY ‘test’, I get an error saying it cannot find the file, even if they are in the same directory.

I’m not sure if I’m misunderstanding the documentation or if it’s a compiler issue.

The compiler I’m using is IBM COBOL for Linux x86

I should also mention that I’m new to the community.

Tim Fors's profile image
Tim Fors

Please paste a snippet of your makefile where these export commands are so I can see them in context. Also, what happens if you remove the colon ':' from the assignments?

Eduardo Pozos Huerta's profile image
Eduardo Pozos Huerta

Makefile Code

# ********************
# *** Set Commands ***
# ********************

RM      := rm
RMFLAGS := -rf

# *******************************
# *** Environment C Variables ***
# *******************************

export C_INCLUDE_PATH := include

# ***********************************
# *** Environment COBOL Variables ***
# ***********************************

export SYSLIB    := include:include/reymon
export COBOPT    := 
export COBCPYEXT := .cpy
export COBLSTDIR := build/list

# ************************************
# *** Environment Linker Variables ***
# ************************************

export LIBRARY_PATH := lib

Tim Fors's profile image
Tim Fors

Instead of "-q64", specify "addr(64)" (including the quotes). However, note that this option is not necessary since the default compilation mode for the V1.2 compiler is 64 bit.

Regarding COBCPYEXT, please paste the exact line from your source that contains the COPY statement, and also do an "ls" to show the .cpy file in the filesystem and paste that output. 

Eduardo Pozos Huerta's profile image
Eduardo Pozos Huerta

The exact code for the copy command is COPY "file/control/reydb.cpy". This is because I was unable to use COBCPYEXT and the ls is in include/file/control

Tim Fors's profile image
Tim Fors

I can try to determine why COBCPYEXT isn't working for you, but I'll need to see the original COPY statement before you changed it to work around the problem. Thanks