Using JSMGETENV program to access CGI variables
| Date: | 15 July 2014 |
|---|---|
| Product/Release: | LANSA Integrator - All Versions |
| Abstract: | Using JSMGETENV program to access CGI variables |
| Submitted By: | LANSA Technical Support |
Often developers are required to access the CGI variables. JSM provides a JSMGETENV program to allow this.
The JSMGETENV program can be used in the JSMADMEXT, JSMPXYEXT, JSMDRTEXT and JSMLSAEXT programs to read CGI environment variables.
The program status code will have one of the following values: OK, ERROR or NOVAR.
DCL VAR(&ENVNAME)
TYPE(*CHAR) LEN(128)
DCL VAR(&ENVVALUE) TYPE(*CHAR) LEN(1024)
DCL VAR(&ENVSTS) TYPE(*CHAR) LEN(5)
CHGVAR VAR(&ENVNAME) VALUE(HTTPS)
CALL PGM(JSMGETENV) PARM(&ENVNAME &ENVVALUE &ENVSTS)
IF COND(&ENVSTS *NE 'OK') THEN(DO)
GOTO END
ENDDO