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



Hi Peter,

A few questions:

1) Is the configuration on the two servers the same? That is - is one server
configured to convert the data to/from ascii for you and the other not? 

From the API doc for the output variable that contains the value set by the
server for the requested environment variable: In CGI input mode %%MIXED%%,
this value will be in CCSID 37; otherwise, it will be in the CCSID of the
current job. Note that the QUERY_STRING in %%BINARY%% mode is not converted
by the server.

Also from the API doc: When the API is unable to determine the value for the
requested environment variable, the length of the environment variable value
is set to zero.
 
2) Are you certain your client is doing a GET and not a POST? Is the data
you need contained within the url? As you are probably aware, the query
portion of a url is placed in the QUERY_STRING environment variable by the
server, but any POSTed form data is placed in your program's standard input.
Your code assumes a GET is performed and a query string is present. I am
just checking this is what you have done in your browser.

3) Are you sure your program is not returning with an error before it gets
to the line in question? If there is an error then your HTML headers may
have been set prior to the error and the result would give the illusion that
everything was fine except your QUERY_STRING was empty.

So my guess is that either your server is passing ascii data and the API
can't determine the length of the data, or the client is not passing a query
string so the server doesn't pass it on, or there is an error before the
line is hit. 

I'd check these three first.
 
Cheers

Larry Ducie


P.S. As an aside - for alternatives to QtmhGetEnv() you could look into
using:
1) getenv() - faster
2) QzsrGetEnvCCSID() - looks after ccsid variations
3) QzhbCgiParse() - retrieves QUERY_STRING environment varible for get
method or retrieves data from standard input for a post method

Option 3 removes the need for the standard server code of checking the
CONTENT_LENGTH environment variable to see if there is anything on standard
input (from a POST), if none there then checking the QUERY_STRING
environment variable for any query input (from a GET). It is a nice option
as you can change your HTML pages to POST the data (to remove the annoying
query data from the url) and you never need to change you RPG code.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.