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!
Scope of environment variables
-
- Posts: 68
- Joined: Fri Aug 27, 2010 6:51 pm
- Skillset: Nothing
- Referer: Nonone
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: Scope of environment variables
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.
-
- Posts: 68
- Joined: Fri Aug 27, 2010 6:51 pm
- Skillset: Nothing
- Referer: Nonone
Re: Scope of environment variables
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?
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?
-
- Similar Topics
- Replies
- Views
- Last post
-
- 6
- 2940
-
by willy jensen
View the latest post
Mon Aug 21, 2023 4:56 pm
-
- 5
- 1834
-
by macuko
View the latest post
Tue Jun 27, 2023 8:24 pm
-
- 3
- 2391
-
by sergeyken
View the latest post
Sat Jul 24, 2021 6:29 am