Operating System - HP-UX
1831677 Members
2204 Online
110029 Solutions
New Discussion

Error "Environment variable COBDIR not set"

 
Amith_2
Frequent Advisor

Error "Environment variable COBDIR not set"


When i try to execute a cobol applicaiton program i get the error
"Environment variable COBDIR not set"

I have set the COBDIR variable to the COBOL installation directory. But still i am getting this error.

Can anyone help me out in this. I am able to execute cobrun which will give the COBOL version.
6 REPLIES 6
Alex Lavrov.
Honored Contributor

Re: Error "Environment variable COBDIR not set"

I'm not familiar with COBOL, but maybe you should export the variable.

export COBDIR=blabla

I don't give a damn for a man that can only spell a word one way. (M. Twain)
Bharat Katkar
Honored Contributor

Re: Error "Environment variable COBDIR not set"

Hi Amith,
I think you have set the variable but not exported it and hence the subshell is not able to get the variable. DO it as:

1. # export COBDIR=/xxx/yyy
or
2. # COBDIR=/xxx/yyy
# export COBDIR

Then to check whether it is set properly or not do:

# env | grep COBDIR

This should display the COBDIR variable along with the value set i.e. your directory.

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Sudeesh
Respected Contributor

Re: Error "Environment variable COBDIR not set"

Hi,

Look like you have not exported the variable.

#export COBDIR=/xxx/yyy
#env

and look for COBDIR.


Sudeesh
The most predictable thing in life is its unpredictability
Amith_2
Frequent Advisor

Re: Error "Environment variable COBDIR not set"

I have exported the variable and can see the path correctly when i do an echo $COBDIR.

I can see the path correctly in the output of "set" as well as "env" commands.

Is there any other reasons for the error to occur?
Muthukumar_5
Honored Contributor

Re: Error "Environment variable COBDIR not set"

Export COBDIR variable contents in to shell environment.

COBDIR=/cobdir
export COBDIR

Read this for reference more,
http://docs.hp.com/cgi-bin/doc3k/BB243390046.15153/73

hth.
Easy to suggest when don't know about the problem!
Indira Aramandla
Honored Contributor

Re: Error "Environment variable COBDIR not set"

Hi Amith,

COBDIR is the variable to be set if you are using Micro-Focus COBOL to compile and execute applications written in COBOL.

For Micro-Focus COBOL 4.1 the $COBDIR will be pointing to /opt/cobol/cobdir
i.e export COBDIR=/opt/cobol/cobdir

For Micro-Focus COBOL 4.2 onwards the path has chamged to /opt/lib/cobol.

i.e export COBDIR=/opt/lib/cobol

Indira A
Never give up, Keep Trying