Scope of environment variables



Support for C, C++, COBOL, PL/I, Fortran and assembler applications' runtime Environment LE.

Scope of environment variables

Postby LotharLochkarte » Tue Nov 16, 2010 3:34 pm

Hi,

can anybody explain the scope of an environment variable to me?

With the LE callable service CEEENV I was able to set an environment variable within a COBOL program and to read it by the same program.

But my aim was to create something like a "global variable" that is valid even after the termination of my cobol program.

However, if I have a program A that sets an environment variable, I am not able to read this environment variable with a program B. (I tried it with IMS MPPs, if it is relevant)

So my question is: Did I make a mistake somewhere or are "environment variable" the wrong concept for my purpose?

(I have searched the "LE concept guide" before, but I didn't find useful information there)

Best regards!
LotharLochkarte
 
Posts: 68
Joined: Fri Aug 27, 2010 6:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Scope of environment variables

Postby Robert Sample » Tue Nov 16, 2010 3:48 pm

Environment variables have the scope of the task. For a batch job, the task ends when the job ends -- and hence the environment variables will not survive the job ending.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Scope of environment variables

Postby LotharLochkarte » Tue Nov 16, 2010 4:00 pm

Thank you for your quick reply!

The "task" of an IMS MPP is the dependent region where it runs, right?. So the environment variable should be visible even after the termination of MPP A, so my MPP B (running in the same dependent region) should be able to see this variable?
LotharLochkarte
 
Posts: 68
Joined: Fri Aug 27, 2010 6:51 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Language Environment

 


  • Related topics
    Replies
    Views
    Last post