How to Resolve Cobol error – cob: command not found |

How to Resolve Cobol error – cob: command not found

While compiling Cobol programs in any PeopleSoft application, you may face an error similar to one shown below. If you are compiling a single Cobol program, you will see that Cobol program name show up in the error message but most likely you will be compiling for PS_HOME, PS_APP_HOME or PS_CUST_HOME, so this error will show up for all the Cobol programs belonging to that HOME.

You will see something similar to below:

/opt/oracle/psft/pt/ps_home8.59.08/setup/pscbl_mf.mak : All COBOL files were converted for Unicode successfully
/opt/oracle/psft/pt/ps_home8.59.08/setup/pscbl_mf.mak : Compiling EGPCSRVC.cbl ...
/opt/oracle/psft/pt/ps_home8.59.08/setup/pscbl_mf.mak: line 249: cob: command not found
cp: cannot stat 'EGPCSRVC.gnt': No such file or directory
cp: cannot stat 'EGPCSRVC.int': No such file or directory
cp: cannot stat 'EGPCSRVC.lst': No such file or directory
/opt/oracle/psft/pt/ps_home8.59.08/setup/pscbl_mf.mak : Compiling PSPTCSRC.cbl ...
/opt/oracle/psft/pt/ps_home8.59.08/setup/pscbl_mf.mak: line 249: cob: command not found
cp: cannot stat 'PSPTCSRC.gnt': No such file or directory
cp: cannot stat 'PSPTCSRC.int': No such file or directory
cp: cannot stat 'PSPTCSRC.lst': No such file or directory
/opt/oracle/psft/pt/ps_home8.59.08/setup/pscbl_mf.mak : Compiling PSPTCTBL.cbl ...
/opt/oracle/psft/pt/ps_home8.59.08/setup/pscbl_mf.mak: line 249: cob: command not found
cp: cannot stat 'PSPTCTBL.gnt': No such file or directory
cp: cannot stat 'PSPTCTBL.int': No such file or directory
cp: cannot stat 'PSPTCTBL.lst': No such file or directory

How to Resolve Cobol error – cob: command not found

The keyword here is mentioned in bold text:

/opt/oracle/psft/pt/ps_home8.59.08/setup/pscbl_mf.mak: line 249: cob: command not found

You can make out from the above statement that the error is "cob: command not found" and it was received when running the pscbl.mak program.

The obvious root cause of the issue is that the Cobol compiler executible "cob" was not found when running pscbl.mak. There could be a few reasons for why cob was not found:

1. Cobol compiler was not installed. If it is a new server or a new PUM install, it is likely that Cobol compiler was never installed and hence, you are getting this error. Please follow the installation steps to install Cobol compiler.

2. Cobol compiler is installed but still it says "cob not found" -- the likely reason for this is that environment variable is not set correctly. This issue usually occurs when you have a new server or new PUM.

The usual location of cob is /opt/microfocus/VisualCOBOL/bin 

The environment variable, COBDIR represents the directory where the compiler is installed and is usually set to /opt/microfocus/VisualCOBOL

So, the usual location of cob is /opt/microfocus/VisualCOBOL/bin i.e. $COBDIR/bin

Your PATH environment variable needs to have /opt/microfocus/VisualCOBOL/bin or $COBDIR/bin

3. Adequate permission to invoke cob is missing. Have a look at directory permissions and the userid that is compiling the Cobols. Sometimes it is just a simple case of Cobol compiler is installed and environment variable is set correctly and you are just not invoking the compiler under the correct sudo account. This usually happens in an environment that already exists.

Apurva Tripathi
 

>