Hi..
Env Ubuntu 24.04 with Gnucobol installed from Ubuntu repository
cobc (GnuCOBOL) 3.1.2.0
Built Apr 14 2024 07:59:15 Packaged Dec 23 2020 12:04:58 UTC
C version "13.2.0"
loading standard configuration file 'default.conf'
PRB:
Source files to be compiled are in direcotry
~/MyPgm/Cobol
COPY files are in the direcotory
~/MyPgm/Cobol/copy
when i try to compile it soes not find copy files
How to specify to gnucobol this directory ?
thanks in advance for the support
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Set environmental variable
COBCPY= your copybook directory
COBCPY= ~/MyPgm/Cobol/copy
Last edit: Mickey White 2025-03-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2025-03-12
Hi Mickey
Thanks for the quick answer ...
for my knowledge..
investigating .. i issue "cobc --info " command and i get
COB_COPY_DIR : /usr/share/gnucobol/copy
which is the search order ?
1) COB_COPY_DIR
2) COBCPY
thanls for the support
Maurizio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maurizio, Welcome and if you login to the discussion board, your post will not have to be moderated (waiting) and it will post immediately.
I would not really know Which is first,
I put all my (user) copybooks in my dev or prd directory
COB_COPY_DIR : /usr/local/share/gnucobol/copy
env: COBCPY : /home/mickeyw/cpy:/home/mickeyw/prd/cpy
I have no problem there. it searches /home/mickeyw/cpy first before the prd/cby
COBCPY=/home/mickeyw/cpy:/home/mickeyw/prd/cpy
Last edit: Mickey White 2025-03-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi..
My programmers guidi is old ihas not 10.1.6 it just end at 10.1.5 , i 'll download the last version
next
if i put .cpy files to COB_COPY_DIR it works
if i put .cpy files to COBCPY it is unalble to find files
(i added COBCPY ro .bashrc file via export... logoff end then logon)
here the output of cobc --info
COBCPY overrides COB_COPY_DIR which is the "real" name. It is possible that the first one goes away with GnuCOBOL 4.
So I suggest dropping COBCPY altogether and set COB_COPY_DIR - but only if you need it.
Commonly it is better to just do something like:
cobc -I $HOME/MyPgm/Cobol/copy -o $HOME/MyPgm/Cobol/bin/some.so $HOME/MyPgm/Cobol/some.cob, or something along cd $HOME/MyPgm/Cobol/bin; cobc -I $HOME/MyPgm/Cobol/copy $HOME/MyPgm/Cobol/some.cob
Last edit: Simon Sobisch 2025-06-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks to all for the support.. i fix the problem and it was a my error..
This is the first time i use lubuntu.. in the past i was using debian..
Debian works with root user and normal users ...
Lubuntu works with a normal user, but it is in he sudo list...
I compile my programs using a script, it compiiles executables and move them to system libraries , to perform this second step it neeeds root privilege...
so i issue
sudo sh compall.sh
i modified .bashrc of the user and cobc --info reports COBCPY , but is i issue
sudo cobc --info
it does not show COBCPY because i did not modify bash settings in /etc library
so it works as designed... it was i my error ... i apologyze and renew my thanks to all people supported me
Maurizio
❤️
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi..
Env Ubuntu 24.04 with Gnucobol installed from Ubuntu repository
cobc (GnuCOBOL) 3.1.2.0
Built Apr 14 2024 07:59:15 Packaged Dec 23 2020 12:04:58 UTC
C version "13.2.0"
loading standard configuration file 'default.conf'
PRB:
Source files to be compiled are in direcotry
~/MyPgm/Cobol
COPY files are in the direcotory
~/MyPgm/Cobol/copy
when i try to compile it soes not find copy files
How to specify to gnucobol this directory ?
thanks in advance for the support
Set environmental variable
COBCPY= your copybook directory
COBCPY= ~/MyPgm/Cobol/copy
Last edit: Mickey White 2025-03-12
Hi Mickey
Thanks for the quick answer ...
for my knowledge..
investigating .. i issue "cobc --info " command and i get
COB_COPY_DIR : /usr/share/gnucobol/copy
which is the search order ?
1) COB_COPY_DIR
2) COBCPY
thanls for the support
Maurizio
Maurizio, Welcome and if you login to the discussion board, your post will not have to be moderated (waiting) and it will post immediately.
I would not really know Which is first,
I put all my (user) copybooks in my dev or prd directory
COB_COPY_DIR : /usr/local/share/gnucobol/copy
env: COBCPY : /home/mickeyw/cpy:/home/mickeyw/prd/cpy
I have no problem there. it searches /home/mickeyw/cpy first before the prd/cby
COBCPY=/home/mickeyw/cpy:/home/mickeyw/prd/cpy
Last edit: Mickey White 2025-03-12
Hi,
please have a look at chapter 10.1.6 Locating Copybooks of Programmers Guide.
Hi..
My programmers guidi is old ihas not 10.1.6 it just end at 10.1.5 , i 'll download the last version
next
if i put .cpy files to COB_COPY_DIR it works
if i put .cpy files to COBCPY it is unalble to find files
(i added COBCPY ro .bashrc file via export... logoff end then logon)
here the output of cobc --info
COB_COPY_DIR : /usr/share/gnucobol/copy
env: COBCPY : /home/bong/MyPgm/Cobol/copy
i suspect my version buggy
let me know your opinion
Thanks
Maurizio
COBCPY
overridesCOB_COPY_DIR
which is the "real" name. It is possible that the first one goes away with GnuCOBOL 4.So I suggest dropping
COBCPY
altogether and setCOB_COPY_DIR
- but only if you need it.Commonly it is better to just do something like:
cobc -I $HOME/MyPgm/Cobol/copy -o $HOME/MyPgm/Cobol/bin/some.so $HOME/MyPgm/Cobol/some.cob
, or something alongcd $HOME/MyPgm/Cobol/bin; cobc -I $HOME/MyPgm/Cobol/copy $HOME/MyPgm/Cobol/some.cob
Last edit: Simon Sobisch 2025-06-25
You can specify the directory for COPY files using the -I option in the cobc command. Try compiling with:
swift
cobc -I ~/MyPgm/Cobol/copy -x your_program.cob
This tells GnuCOBOL where to look for COPY files. Hope this helps!
Thanks to all for the support.. i fix the problem and it was a my error..
This is the first time i use lubuntu.. in the past i was using debian..
Debian works with root user and normal users ...
Lubuntu works with a normal user, but it is in he sudo list...
I compile my programs using a script, it compiiles executables and move them to system libraries , to perform this second step it neeeds root privilege...
so i issue
sudo sh compall.sh
i modified .bashrc of the user and cobc --info reports COBCPY , but is i issue
sudo cobc --info
it does not show COBCPY because i did not modify bash settings in /etc library
so it works as designed... it was i my error ... i apologyze and renew my thanks to all people supported me
Maurizio