The Environment block has been essentially the same since MS/DOS. In
the 1980's (?) I wrote code in 8086 Assembler and Digital Research PL/I
and C to access the Environment. I even wrote code to set the
environment - it wasn't pretty!
Really it is pretty easy to read the environment. C has all sorts of
macros and routines. Assembler is easy once you have the address of the
block. I asked Google's AI for some 370 assembler code to read the
environment (see next email).
With Linux and Windows, each program gets it's own copy of the parent's
environment variables. You can read or write happily to your own
environment, but setting the parent's environment isn't allowed. It
seems that Windows, Linux and presumably UCC don't like have the current
level of Environment Variables messed with!
I tried to set the parent's environment variables using various things
recently, and kept on failing. I even wrote some code to stuff the
keyboard in Windows with SET statements. It worked beautifully, until I
ran the code in a script or BAT file. Unfortunately, Windows got the
next statement muddled up with the stuffed keyboard characters. FAIL!
So I just wrote some code to create another script or file with just
some SET statements, and when my program (a simple to use PANEL) had
accepted all the user input, I just wrote it to a file, and made sure
that it was executed before the next BAT file statement.
I don't have access to a Z/OS machine so I can't test the routine on
UCC, but it should work fine. And with things like VIO, it should be
fast. It's in Github.
Clem
Colin Paice wrote:
See getenv()
<https://www.ibm.com/docs/en/zos/3.1.0?topic=functions-getenv-get-value-environment-variables>.
I dont know about assembler.
On Mon, 2 Oct 2023 at 08:27, David Cole <[email protected]> wrote:
We are beginning to write support for USS. I personally don't know
much at all about USS (there are others here who do), so please help
me along if there are terms I'm not using quite correctly.
We have a need for our code to access environment variables. I am
being told that they can be accessed easily by C programs but are
unavailable to Assembler programs.
Is this true? Is there no way whatsoever for an Assembler program to
gain access to environment variables? Is this truly an issue that no
one has solved?
Inquiring minds want to know.
Thanks,
Dave Cole, Developer
[email protected] (personal)
[email protected] (business)
540-456-6518 (cell)
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN