I've written the following simple program to test persistent CGI. I
was expecting to see the same job number on every submit request, but
it is NOT the case, everytime I submit the page a new JOB_NUM is
displayed and another HTTP job is initiated. Am I missing something?

*+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++
+++++++++
* Compilation Instructions
*+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++
+++++++++
* CRTRPGMOD MODULE(&LIB/PERSIST) SRCFILE(&LIB/QHTMLESRC)
DBGVIEW(*LIST)
* CRTPGM PGM(&LIB/PERSIST) BNDSRVPGM(QHTTPSVR/QTMHCGI)
ACTGRP(QILE)
*+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++
+++++++++
/copy qcpysrc,prqsys
/copy qcpysrc,dsqsys

D HTML s 100a ctdata dim(19)
D ii s 2s 0
D NL c X'15'

/free
HTML_buffer = *blanks;

// prepare HTML page
for ii = 1 to %elem(HTML);
HTML_buffer = %trimr(HTML_buffer) + %trimr(HTML(ii)) + NL;
endfor;
HTML_buffer = %replace(%char(PSDS.JOB_NUM) : HTML_buffer :
%scan('<%JOB_NUM%>' : HTML_buffer) : 11);

// write HTML page
HTML_bufferLen = %len(%trim(HTML_buffer));
QSYS_wrStout(HTML_buffer : HTML_bufferLen : HTML_errorCode);

return;
/end-free
** HTML
Accept-HTSession: 0001
HTTimeout: 3
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




Sample Persistent CGI



action="~/persist.pgm/0001">

Running under job number-> <%JOB_NUM%>






Here is the persistent CGI directives from the configuration file.

MaxPersistentCGI 16
PersistentCGITimeout 20 minutes
MaxPersistentCGITimeout 60 minutes

TIA