× 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.



ok,

compile options:
CRTRPGMOD  MODULE(JVKSYS87MD/WWWCGILIST) +
             SRCFILE(JVKSYS87MD/QRPGSRC) DBGVIEW(*ALL) +
             TGTRLS(V5R2M0)
CRTPGM     PGM(JVKSYS87MD/WWWCGILIST) +
             MODULE(JVKSYS87MD/WWWCGILIST) +
             BNDSRVPGM(QTCP/QTMHCGI) ACTGRP(*CALLER) +
             TGTRLS(V5R2M0)

The source:


HDATFMT(*EUR) DATEDIT(*DMY)
H BNDDIR('QC2LE')
 * File Definings ---------------------------------------*
D* Field Definings --------------------------------------*
 * Variables for the CGI interface API for QtmhRdStIn.
DBufIn            S           1024a   INZ
DBufInLn          S              9b 0 INZ(1024)
DStdInLn          S              9b 0
 *Variables for the CGI interface API for QtmhWrStout.
DBufOut           S           2048a   INZ
DBufOutln         S              9b 0
 * Compile-time array for HTML output.
DContentLn        S              9B 0 INZ(0)
DEnvQS            S             20A   INZ('QUERY_STRING')
DerrSwitch        S              1A   INZ(' ')
DEnvQuery         S           1024A   INZ
 *** Constants for names of CGI APIs.
DAPIStdIn         C                   'QtmhRdStin'
DAPIStdOut        C                   'QtmhWrStout'
 * prototype for QtmhGetEnv API
DAPIGetEnv        PR                  extproc('QtmhGetEnv')
D                            32767A   OPTIONS(*VARSIZE)
D                               10i 0 Const
D                               10i 0
D                               30A   Const OPTIONS(*VARSIZE)
D                               10i 0 Const
D                               16A   OPTIONS(*VARSIZE)
 * variables used for QtmhGetEnv & QtmhPutEnv calls
DEnvRec           S          32767
DEnvRecLen        S             10i 0 inz(%size(EnvRec))
DEnvLen           S             10i 0
DEnvName          S             30
DEnvNameLen       S             10i 0
D* Array, Program status & Field defingings -------------*
DQUSEC            DS
D QUSBPRV                 1      4B 0
D QUSBAVL                 5      8B 0
D QUSEI                   9     15
D QUSERVED               16     16
C*------------------------------------------------------------------------*
C* MAIN     - Main routine                                                *
C*------------------------------------------------------------------------*
C* Open file
C                   exsr      srGetEnvQry
C                   exsr      srTestOut
C* Exit
C     MAIN99        tag
C                   eval      *inlr=*on
C*------------------------------------------------------------------------*
C* srGetEnvQry - Get QueryString                                          *
C*------------------------------------------------------------------------*
C     srGetEnvQry   begsr
C*
C                   MOVEL(p)  EnvQS         EnvName
C                   exsr      srGetEnv
C                   movel     EnvRec        EnvQuery
C*
C     GetEnvQry99   endsr
C*------------------------------------------------------------------------*
C* srGetEnv - Get Environment variables                                   *
C*------------------------------------------------------------------------*
C     srGetEnv      begsr
C*
C                   clear                   qusec
C                   eval      QUSBAVL = 0
c                   Eval      qusbprv = %size(QUSEC)
C* Retrieve the request_method
C     ' '           checkr    EnvName       EnvNameLen
C                   callp     APIGetEnv(EnvRec:EnvRecLen:EnvLen:
C                                       EnvName:EnvNameLen:qusec)
C*
C     GetEnv99      endsr
C*------------------------------------------------------------------------*
C* srTestOut - Output to browser                                          *
C*------------------------------------------------------------------------*
C     srTestOut     begsr
 *
C                   eval      BufOut= 'Content-Type: text/html' +
C                                     'Debug:' +
C                                  '<BR>Query_str: ' + %trim(envQuery)
C                   eval      BufOutLn = %len(%trim(BufOut))
 **** Send BufOut to standard output.
C                   callb     APIStdOut
C                   parm                    BufOut
C                   parm                    BufOutLn
C                   parm                    QUSEC
 *
C     TestOut99     endsr

I hope anyone can read it....

thanks,

Henk.





-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bob Cozzi
Sent: donderdag 29 juli 2004 22:25
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: CGI-programming.....


Well, we're only seeing a partial picture and then your description.
You need to post the source code that's blowing up including the data
structure, the prototype and the call (along with D specs for any parms
you're passing the QtmhGetEnv.
-Bob


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Henk Schipper
Sent: Thursday, July 29, 2004 2:49 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: CGI-programming.....

Hi Bob,

I am using QUSEC. The standard ds from QSYSINC.
the first field (4 bytes) I initialised is with the number 16 the others I
do not touch.
I tried now your suggestion. x'00' in the first 4 bytes.
The message as descibed below comes first, rightaway after that with
'pointer not set for location referenced'.
put back the %sizing.. wich should be :
C                   eval      qusbprv = 16
which gives me the same message only as descibed below.
The weird thing is, when i restart the server, the first time it works.
Every call afterwards, results in the message as below.
The error parm:
DQUSEC            DS
D QUSBPRV                 1      4B 0
D QUSBAVL                 5      8B 0
D QUSEI                   9     15
D QUSERVED               16     16

Where QUSBPRV is initialised with 16 (or %size(QUSEC) which results in the
same value).

I hope you have more suggestions for me.
My feeling is that PASE (under V5R3) has the same error which was in V4R4 or
V4R5 (I do not know anymore which one.... already about 4 years ago). The
error was memory reallocation which results in these kind of errors.

Thanks,

Henk.


-----Original Message-----
From: rpg400-l-bounces+hs=xs4all.nl@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+hs=xs4all.nl@xxxxxxxxxxxx]On Behalf Of Bob
Cozzi
Sent: donderdag 29 juli 2004 18:49
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: CGI-programming.....


Are you using the error parm?
If not, move *ALLX'00' into that field/data structure. Or at least make sure
the first 4 bytes are X'00'.
If you are, initialize the first 4 bytes to the length of the DS itself.
That is:
  Eval  nErroDSLen = %size(ErrorDS)

Hope this helps.
-Bob


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Henk Schipper
Sent: Thursday, July 29, 2004 10:51 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: CGI-programming.....

Thanks Bob,

But I tried that as well.... Also now. I copied exactly your prototype.
Still the same error....
Message-ID . . . . . . :   CPF3CF1
Date send      . . . . :   29-07-04      Time Send      . . :   17:45:43

Message . . . . :   Error code parameter not valid.

Cause . . . . . :   The format of the error code parameter is not correct.
Recovery  . . . :   Correct the error code parameter and try the request
  again.  If you do not know the correct format for the error code
parameter,
  see the OS/400 APIs topic in the Information Center,
  http://www.ibm.com/eserver/iseries/infocenter.

thanks,

Henk.


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bob Cozzi
Sent: donderdag 29 juli 2004 17:28
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: CGI-programming.....


Your parameter definitions are not complete. To fix your specific problem,
add the OPTIONS(*VARSIZE) keyword to the last parameter.
Overall however, you should consider the following prototype for QtmhGetEnv
instead:

DAPIGetEnv        PR                  extproc('QtmhGetEnv')
D                            32767A   OPTIONS(*VARSIZE)
D                               10i 0 Const
D                               10i 0
D                               30A   Const OPTIONS(*VARSIZE)
D                               10i 0 Const
D                               16A   OPTIONS(*VARSIZE)

-Bob Cozzi


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Henk Schipper
Sent: Thursday, July 29, 2004 10:12 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: CGI-programming.....

Hi All,

I developed a tool for CGI with the apache webserver under V5R2M0. Worked
all fine. No troubles
I use the api QtmhGetEnv the following way:
 * prototype for QtmhGetEnv API
DAPIGetEnv        PR                  extproc('QtmhGetEnv')
D                            32767
D                               10i 0
D                               10i 0
D                               30
D                               10i 0
D                               16
 * prototype for QtmhPutEnv API
DAPIPutEnv        PR                  extproc('QtmhPutEnv')
D                            32767
D                               10i 0
D                               16
 * variables used for QtmhGetEnv & QtmhPutEnv calls
DEnvRec           S          32767
DEnvRecLen        S             10i 0 inz(%size(EnvRec))
DEnvLen           S             10i 0
DEnvName          S             30
DEnvNameLen       S             10i 0

and the calls:
C                   eval      qusbprv = 16
C* Retrieve the request_method
C     ' '           checkr    EnvName       EnvNameLen
C                   callp     APIGetEnv(EnvRec:EnvRecLen:EnvLen:
C                                       EnvName:EnvNameLen:qusec)

At the moment we upgraded from V5R2 to V5R3. Latest Cum, also the ptf
retrieved and applied which IBM requested:
      5722999 MF33122 (June 2004)
      5722SS1 SI12639 (June 2004)


I keep getting an error: Error code parameter not valid

What Am I doing wrong? Or is Pase at the moment a bit mixed up?
Any help is very appriciated...


Regards,

Henk
--
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.


--
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.


--
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.