× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks to all that provided input. I can use your suggestions to create
the necessary programs.

Tom Armbruster

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S. Waterbury
Sent: Thursday, February 14, 2008 9:39 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Environment Variables in RPGLE

Hi, all:

I just did a google search for "RTVENVVAR" and found this (courtesy of
Bob Cozzi's web site):


http://www.rpgiv.com/cgi-rpg/viewsrc?FILE=QRPGLESRC&LIB=RPGLAB&MBR=RTVEN
VVAR
and

http://www.rpgiv.com/cgi-rpg/viewsrc?FILE=QCMDSRC&LIB=RPGLAB&MBR=RTVENVV
AR

Cheers,

Mark S. Waterbury

Scott Klement wrote:
Hello,


AFAIK, the /current/ CL method is to call the APIs. This assumes a
few things -- (1) we're talking about ILE CL, (2) you're compiling
on V5R4 with target release of V5R2 or later and (3) the systems are
properly PTFed.



FWIW... getenv() and Qp0zGetEnv() both require support for pointers,
which didn't exist until V5R4, and was buggy when V5R4 was released.
So,
you want to make sure you're on V5R4 and up-to-date on PTFs.

If you really want to do this in pure CL prior to V5R4, you might
consider the QtmhGetEnv() API. It does not require pointers, and is
available on older releases. The disadvantage is that it requires
the
HTTP server to be installed, but it retrieves the exact same
environment
variables as the other APIs (I'm sure it calls Qp0zGetEnv() under the
covers) without the pointer logic.

However, again, due to the complexity of calling CALLPRC and then
doing
pointer logic in CL, it would (IMHO) be a much better idea to write an

RPG program and give it a *CMD front end, so you could implement a
RTVENVVAR command. Then, call that from CL. That way, all future
applications that need environment variables can easily call your
RTVENVVAR command. It'll be easy for the next programmer to read your

CL code and easy to reuse your techniques.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.