Hello,
Greetings of the day. I am now trying to setup Visual Cobol Personal Edition for Eclipse on Ubuntu (by using Windows Subsystem for Linux). I have been able to configure as much as possible, however, while trying to setup some things, I am seeing it is NOT working. Please see below:
- I set the COBCPY command to point to different folders/sub-folders (for copy codes - folders are outside of the source folder), exported COBCPY and verified the environment - it's showing accurately - however, while accessing the copy codes - the program is unable to pick those copy books (different folders that are NOT in the program source folder).
- PLEASE IGNORE THIS 2nd point - got it resolved - While creating indexed data files, looks like the default IDXFORMAT is being used, however, there is NO separate ".IDX" file for the index. I tried setting the "extfh.cfg" - unfortunately, though I export and have the environment in place - this is NOT being read OR there is NO change in the way the program creates the indexed files.
Could someone kindly help how to resolve this?
Thanks in advance for all your help, it is highly appreciated.
Ravi
------------------------------
Ravichandran TS
Going to Retire
Self Registered
Hyderabad IN
------------------------------
Hi Ravi,
Are you using the Eclipse IDE or the command line when compiling?
When I set COBCPY in my environment at login to point to a different folder than the project folder it is working fine.
If you are working within the IDE you can also set this using the following project property:

Can you please provide more details of how exactly you are setting this up?
What file extensions do your copybooks have?
What is the content of the COBCPY environment variable?
------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------
Hi Ravi,
Are you using the Eclipse IDE or the command line when compiling?
When I set COBCPY in my environment at login to point to a different folder than the project folder it is working fine.
If you are working within the IDE you can also set this using the following project property:

Can you please provide more details of how exactly you are setting this up?
What file extensions do your copybooks have?
What is the content of the COBCPY environment variable?
------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------
Hi Chris,
Thank you for taking time to review my issue, highly appreciated. I DO NOT use the IDE, I am using the command line computing.
The copy books are all stored in separate folders:
- /home/tsrav/SE - this folder contains all files SELECT clause (the file names are for each FD separate SE file - NO extension)
- Example: - EMPMAST
- /home/tsrav/FD - this folder contains all files FD's
- Example: - EMPMAST
- /home/tsrav/CC - this folder contains all common routines used in procedure division
- Example: - (EMPMAST) contains code snippet as DISP-EMP-MAST..... DISP-EMP-MAST-EXIT.
- Separate folders for "WS" (Working Storage related common files), "IO" (common file-wise read/start/write/rewrite etc.,
With above folders all in my home directory, my source code is placed in separate folder /home/tsrav/COBSRC1
So, I setup and exported as COBCPY=/home/tsrav/
In one of the working storage copy-code, for your reference:
01 WS-DUMMY PIC X(01) VALUE " ".
01 WS-DISP-TEXT-30 PIC X(30) VALUE SPACES.
I use the "COPY WS/WSVARTST" code in my program (as COBCPY is set as /home/tsrav/) the copy statement should read the "WS/" folder and pick the file "WSVARTST". This DOES NOT happen.
NOT sure why the COBCPY does NOT work.
As a temporary (alternate) solution, I mapped the symbolic link of different copy code folders within my COBSRC1 folder (as depicted below) - this way, it works fine:
lrwxrwxrwx 1 root root 15 Jun 1 11:16 CC -> /home/tsrav/CC/
lrwxrwxrwx 1 root root 15 Jun 1 11:16 WS -> /home/tsrav/WS/
lrwxrwxrwx 1 root root 15 May 31 15:50 IO -> /home/tsrav/IO/
lrwxrwxrwx 1 root root 15 May 31 15:49 SE -> /home/tsrav/SE/
lrwxrwxrwx 1 root root 15 May 31 15:49 FD -> /home/tsrav/FD/
With the symbolic link in my source folder, the compiler automatically picks up the copy-codes as needed (working correctly).
I hope the above info is clear on what issue I am facing with COBCPY setting.
Thanks,
Ravi
------------------------------
Ravichandran TS
Going to Retire
Self Registered
Hyderabad IN
------------------------------
Hi Chris,
Thank you for taking time to review my issue, highly appreciated. I DO NOT use the IDE, I am using the command line computing.
The copy books are all stored in separate folders:
- /home/tsrav/SE - this folder contains all files SELECT clause (the file names are for each FD separate SE file - NO extension)
- Example: - EMPMAST
- /home/tsrav/FD - this folder contains all files FD's
- Example: - EMPMAST
- /home/tsrav/CC - this folder contains all common routines used in procedure division
- Example: - (EMPMAST) contains code snippet as DISP-EMP-MAST..... DISP-EMP-MAST-EXIT.
- Separate folders for "WS" (Working Storage related common files), "IO" (common file-wise read/start/write/rewrite etc.,
With above folders all in my home directory, my source code is placed in separate folder /home/tsrav/COBSRC1
So, I setup and exported as COBCPY=/home/tsrav/
In one of the working storage copy-code, for your reference:
01 WS-DUMMY PIC X(01) VALUE " ".
01 WS-DISP-TEXT-30 PIC X(30) VALUE SPACES.
I use the "COPY WS/WSVARTST" code in my program (as COBCPY is set as /home/tsrav/) the copy statement should read the "WS/" folder and pick the file "WSVARTST". This DOES NOT happen.
NOT sure why the COBCPY does NOT work.
As a temporary (alternate) solution, I mapped the symbolic link of different copy code folders within my COBSRC1 folder (as depicted below) - this way, it works fine:
lrwxrwxrwx 1 root root 15 Jun 1 11:16 CC -> /home/tsrav/CC/
lrwxrwxrwx 1 root root 15 Jun 1 11:16 WS -> /home/tsrav/WS/
lrwxrwxrwx 1 root root 15 May 31 15:50 IO -> /home/tsrav/IO/
lrwxrwxrwx 1 root root 15 May 31 15:49 SE -> /home/tsrav/SE/
lrwxrwxrwx 1 root root 15 May 31 15:49 FD -> /home/tsrav/FD/
With the symbolic link in my source folder, the compiler automatically picks up the copy-codes as needed (working correctly).
I hope the above info is clear on what issue I am facing with COBCPY setting.
Thanks,
Ravi
------------------------------
Ravichandran TS
Going to Retire
Self Registered
Hyderabad IN
------------------------------
According to the product documentation, COBCPY is working as intended.
In the section Copybook search order it has the rules: (the #1 in bold applies to your case)
Each COPY statement in your program identifies a copybook to be copied. If the filename in the COPY statement is incomplete, because it lacks either an extension or a path, the Compiler searches for it as follows:
- In the directory given by the COPY library-name. Note that if the name of the copybook is a qualified filename; that is, it includes the path or directory, the Compiler searches that directory only.
- In the directory containing the main source program being compiled.
- In the paths specified in the Copybook Paths list in the project properties.
If you have included any copybook projects as project dependencies, they are included in this list.
- In any directories listed in the COBCPY environment variable, in the order specified.
Because you include the directory name in the copybook name it will not use COBCPY.
If you have COBCPY set to only a single entry, like your example, you could include it in your COPY statement.
COPY "$COBCPY:WS/WSVARTST"
or you could use any environment variable.
You could also remove the directory name from the COPY statement and add it to a list of directories in COBCPY:
e.g. export COBCPY=/home/tsrav/SE:/home/tsrav/FD etc,
------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------
According to the product documentation, COBCPY is working as intended.
In the section Copybook search order it has the rules: (the #1 in bold applies to your case)
Each COPY statement in your program identifies a copybook to be copied. If the filename in the COPY statement is incomplete, because it lacks either an extension or a path, the Compiler searches for it as follows:
- In the directory given by the COPY library-name. Note that if the name of the copybook is a qualified filename; that is, it includes the path or directory, the Compiler searches that directory only.
- In the directory containing the main source program being compiled.
- In the paths specified in the Copybook Paths list in the project properties.
If you have included any copybook projects as project dependencies, they are included in this list.
- In any directories listed in the COBCPY environment variable, in the order specified.
Because you include the directory name in the copybook name it will not use COBCPY.
If you have COBCPY set to only a single entry, like your example, you could include it in your COPY statement.
COPY "$COBCPY:WS/WSVARTST"
or you could use any environment variable.
You could also remove the directory name from the COPY statement and add it to a list of directories in COBCPY:
e.g. export COBCPY=/home/tsrav/SE:/home/tsrav/FD etc,
------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------
Thank you Chris, for the help, highly appreciated. Understood the points and noted.
------------------------------
Ravichandran TS
Going to Retire
Self Registered
Hyderabad IN
------------------------------