I was trying to run a batch script and got the below error.
Can't open message file '/opt/microfocus/cobol/rts.msg'
Defaulting to English Messages
Execution error: file ''
error code: 187, pc=0, call=1, seg=0
187 error message text not found
Can someone please help in understanding the above error.

Does /opt/microfocus/cobol/rts.msg exist?
If so, it's probably a file-permissions issue. If you have sufficient access to change the file's permissions, make it readable by everyone (chmod a r /opt/microfocus/cobol/rts.msg).
If it doesn't exist, then probably the environment value COBDIR is not set, or is set to the wrong value, or is not exported. It should be set to your COBOL installation directory, and exported to the environment of your script. You can set and export it in the script itself, or make sure it's in the environment of the shell when you execute the script.