× 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 Bob, but it looks to me as if this API suffers from the same problem, 
i.e. it will work fine on V4R5M0 if compiled at that release, but I suspect 
(can't prove it as I don't have easy access to a V4R5M0 machine) that 
compiling code that uses it on V5R2M0 with TGTRLS(V4R5M0) wouldn't work.

Pete
"Bob Cozzi" <cozzi@xxxxxxxxx> wrote in message 
news:200409071352.i87DqbbK029893@xxxxxxxxxxxxxxxxxxxx
> Don't know if this will solve your problem, but I use Qp0zGetEnv on V4R5 
> and
> later without problem.
> Here's the prototype that is used in the CGILIB (similar to CGIDEV2)
>
>     D Qp0zGetEnv      PR              *   ExtProc('Qp0zGetEnv')
>     D  envvar                         *   VALUE OPTIONS(*STRING)
>     D  nCCSID                       10I 0
>
> The 2nd parm, CCSID, can be set to 0 for the current CCSID.
> Here's the wrapper I built for CGILIB so that you don't have to deal with
> the C string return values:
>
>     P GetEnvVar       B                   Export
>     D GetEnvVar       PI         65535A   VARYING
>     D  pInEnv                         *   VALUE OPTIONS(*STRING)
>
>     D  pEnv           S               *   Inz
>     D  nCCSID         S             10I 0 Inz(0)
>
>     C                   eval      pEnv = Qp0zGetEnv(pInEnv : nCCSID)
>     C
>     C                   if        pEnv = *NULL
>     C                   return    ''
>     C                   endif
>     C                   return    %str(pEnv)
>     P GetEnvVar       E
>
> CGILIB is available in the RPG xTools at www.rpgxtools.com
>
> -Bob Cozzi
>
>
> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx 
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
> On Behalf Of Pete Clifford
> Sent: Tuesday, September 07, 2004 7:56 AM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: getenv API and previous compiler suport
>
> Has anyone run into problems using the "getenv" API to retrieve 
> environment
> variables when compiling for previous releases?
>
> I have some code which uses getenv and which is compiled on V5R2M0 with
> TGTRLS(V4R5M0).
>
> It runs fine on V5R2M0 and above.
>
> On V4R5M0 I get:
>
>     Message ID . . . . . . :   MCH4437       Severity . . . . . . . :   40
>     Message type . . . . . :   Escape
> Date sent  . . . . . . :   07/09/04      Time sent  . . . . . . :
> 10:15:31
>
> Message . . . . :   Program import not found.
> Cause . . . . . :   The calling program (program name) refers to a
> procedure or
>   data export from service program QP0ZCPA which does not exist. The
> calling
>   programs refers to export-ID X'00000031', the service program defines
> only
>   X'0000002F' exports.
> Recovery  . . . :   Recreate the calling program.
> Technical description . . . . . . . . :   The service program has been
> changed
>   in an incompatible manner since the time the calling program was created
> and
>   thus bound to the service program. Recreate the calling program.
>
>
> It looks to me as if getenv was previously exported from QC2UTIL2 but is 
> now
> in QP0ZCPA and that consequently compiling for V5R4M0 won't work.
>
> Anyone got any suggestions how I might retrieve an environment variable in 
> a
> way that can be compiled for V4R5M0 and above, with a single set of
> executables?
>
> Pete
>
> Peter Clifford
> ariadne software
> www.ariadnesoftware.co.uk
>
>
>
>
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>
>
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
> 




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.