CGIDEV2 Change Log 2023-11-08 - Some images were changed. 2023-09-16 - Stream files generated from procedures WrtHtmlToStmf() and WrtHtmlToStmfX() are now assigned DTAAUT(*RX) OBJAUT(*ALL) authorities for USER(*PUBLIC). 2023-01-02 - CGIDEV2 download now available from V6R1M0 (instead of V7R1M0). 2022-10-21 - Small change to procedure upload_validat() in XXXCGIPARS module. 2022-10-01 - Now saved for V7R1 instead of V7R2. 2022-08-19 - New command SRCTOSTMF (Convert source members to stream files) 2022-08-15 - New command CVTSTMFCCS (Convert stream files CCSID). 2022-04-27 - Fixed the initial page of the online Italian User Manual. 2022-02-19 - Provided examples about using CGIDEV2 procedure DSPSTMF(), see page http://cgidev2.easy400.net/cgidev2p/stmftobrow.pgm . 2021-11-02 - All sample CGI programs are now using section identifier "<as400>" instead of "/$". This was done to reduce potential problems in automated CCSID conversion of special characters. 2020-11-30 - Control specifications 'H Debug(*YES)' and 'H AlwNull(*UsrCtl)' added to QRPGLESRC member HSPECS. 2020-11-29 - A new basic demo (Mushroom divisions) shows how to implement a hierarchical sequence of dropdown lists. See page http://cgidev2.easy400.net/cgidev2o/demos.htm#b6 . 2020-11-01 - The CGIDEV2 Tutorial now includes some tips about protecting WEB pages from XSS vulnerability, see page http://cgidev2.easy400.net/cgidev2o/tutorial.htm#11 . 2020-08-01 - The Change Log can now be displayed as an HTML page from the online manual. 2020-05-01 - Updated module SETCGILIB5 to add HTTP directive "CgiConvMode %%EBCDIC/EBCDIC%%" - New command UPDDOCX allows to generate customized 2007 MS WORD documents from document templates (see page http://cgidev2.easy400.net/cgidev/html/exhibiv5.htm). 2020-04-27 - Updated example CGI program UPLOAD to demonstrate the ability to provide regular input fields beside the PC file to be uploaded. 2020-02-25 - Updated program PERSIST01 (made easier to be read) 2018-07-04 - Responsive HTML Design implemented on all CGIDEV2 Basic Demos and Boats Demo. Responsive HTML allows to automatically resize, hide, shrink, or enlarge, a website, to make it look good on all devices (desktops, tablets, and phones). 2018-03-20 - Fixed a bug that would force procedure WrtHtmlToStmf() into a non-ending loop. 2018-03-18 - Procedure WrtHtmlToStmf() now supporting also creation of UTF stream files (CCSID 1200 to 1237). 2018-02-21 - Module XXXCGIPARS was added a piece of code to get rid of the double quotes around the Boundary received from ASP.NET client. (Author: Justin Taylor) 2017-11-01 - Commands ENCRYPTF and DECRYPTF can now optionally use hexadecimal characters for the encrypt/decrypt key. 2017-10-29 - Fixed member INSTALL in CGIDEV2/QREXSRC 2017-10-13 - In encrypt/decrypt procedures fixed errors causing corruption of the encrypted stuff. 2017-10-12 - Performance of the encrypt/decrypt features improved up to 100 times. 2017-10-11 - New procedures and commands to encrypt and decrypt character strings and stream files, see page http://cgidev2.easy400.net/cgidev/html/exhibiw1.htm . 2017-05-27 - Fixed an error message in CGISRVPGM2 procedure AppHtmlStmf() (module XWRKHTML). 2017-03-05 - All RPG programs and service programs are now created with parameters ALWUPD(*YES) ALWLIBUPD(*YES) . - Changes to command REBIND: -- Messages sent for successful and unsuccessful rebindings -- If at least V6R1, the library of bounded service programs can be changed. 2017-01-05 - Service program CGISRVPGM2 is now created with STGMDL(*INHERIT) when OS/400 release at least V7R1. 2016-11-04 - Fixed procedure WrtHtmlStmf() in module XXXWRKHTML. It was returning too soon, before deallocating memory and clearing the output buffer. 2016-09-11 - Command EDBG (Start Enhanced Debug) now prompts command STRDBG, so allowing to specifying other parameters, such as an important one: SRVPGM . 2016-07-15 - In procedures LoadStreamFile() and DspStmf() the object type *DSTMF has now the same dignity as the *STMF one. 2016-07-02 - Pgm HTTPCFG now supporting also APACHE 2.4 changes in HTTP configuration directives 2016-03-13 - CGISRVPGM2 subprocedures DspStmf() and DnlStmf() are now able to download stream files larger than 16 MB. 2016-03-03 - Fixed COMPILE program to fully support V5R2. 2016-02-04 - Fixed program ZIP. 2016-01-27 - Updated the CGIDEV2 install procedure to make sure that it has no problems with system value QSECURITY=50. 2015-09-25 - Added CGI program GETPOST. It allows to validate input of special characters and teaches how to dynamically output a link from a CGI program. See page http://cgidev2.easy400.net/cgidev2p/getpost.pgm . 2015-09-01 - Fixed a smal bug in module SETCGILIB5 of program SETCGILIB. 2015-08-13 - Added CGI program DSPENVVAR. It allows the user to display the meanings and the current values of -- all the HTTP server environment variables -- some Java environment variables 2015-03-17 - Fixed program DEMOMENU. 2015-03-11 - Commands ZIP and UNZIP now supporting also back slashes ( "\" ). 2014-10-10 - On some IBM i boxes, command STRTCPSRV *HTTP HTTPSRV(CGIDEV2APA) was not starting the HTTP instance CGIDEV2APA. In order to start it, the command should have been instead STRTCPSRV *HTTP HTTPSRV(CGIDEV2APA '-AutoStartY') . Therefore, in member CGIDEV2APA of CGIDEV2/QATMHINSTC, -AutoStartN was changed to -AutostartY . 2014-09-26 - Updated CLLE module SETCGILIB to handle the case when the job CCSID is 65535. It will be changed to the default CCSID job value. - Updated RPGLE module SETCGILIB5 so that now the directive "Options +execCGI" is added instead of "Options none". 2014-08-14 - Updated documentation on procedure ZhbGetInput. 2014-07-25 - Joe Guetzlaff (mindstream solutions llc, FL, US) suggested a small change to subprocedure SetUpArrays() in order to recognize a section, if the section name has leading blanks/is indented. 2014-02-25 - Service program CGIDEV2/CGISRVPGM2 was added new subprocedure WrtSectionToStmf(). This procedure may be used to generate on the IFS large stream files exceeding 16 MB. See page http://cgidev2.easy400.net/cgidev2o/exhibiu7.htm#wrtsectiontostmf . 2013-11-27 - Fixed module XXXCGIPARS of srvpgm CGISRVPGM2: it could loop when uploading a PC file to IFS. 2013-11-11 - Command CGIDEV2/CRTSRVPGM parameter ACTGRP now defaults to *CALLER instead of CGIDEV2. 2013-09-13 - Fixed a packaging error which was causing programs ZIP and UNZIP not to be created. - Fixed a documentation error at page http://www.easy400.net/cgidev2o/tutorial.htm#10 . 2013-09-04 - Also compression of full IFS directories now supported on command CGIDEV2/ZIP. 2013-08-30 - Updated service program procedure DSPSTMF(): now it sends the output buffer by itself, the requesting progr am no longer needs to issue a wrtsection('*fini'). - Fixed the case where in command ZIP an IFS path contains embedded blanks. - New parameter JUNK(*YES) on command ZIP prevents recording of directory names. 2013-04-22 - Updated PRG program SETCGILIB2. It was reported having compile problems in correctly resolving file name QRPGLESRC. 2013-04-20 - Fixed member PROTOTYPEB in CGIDEV2/XQRPGLESRC. It wasn't exactly the same as the one from CGIDEV2/QRPGLESRC. 2013-04-05 - In command CGIDEV2/CRTSRVPGM (Create service program CGIDEV2/CGISRVPGM2) you can now specify the name of the activation group to be assigned to service program CGIDEV2/CGISRVPGM2. 2013-03-02 - Updated module XXXCGIPARS for file upload from Internet Explorer. 2013-01-30 - Added a new basic demo to teach creating selection lists and displaying Google maps. See page //http://cgidev2.easy400.net/cgidev2p/capitals.pgm . 2013-01-07 - It was found that IFS objects date/time values are based on UTC/GMT without taking into account system value QUTCOFFSET. Therefore, in the ChkIfsObj... procedures reporting object dates, some code was added to return the correct values. 2012-12-30 - Two new CGISRVPGM2 subprocedures - DspStmf() and DnlStmf() - allow to send to the browser / download a stream file. See page http://cgidev2.easy400.net/cgidev/html/exhibiv4.htm . 2012-11-29 - Updated procedure MultiPartForm of module XXXCGIPARS to support file upload also when Adobe Flash Player is installed. 2012-09-03 - Updated procedure ChkIfsObj4() in order to retrieve, beside the data change timestamp (when created or when data changed), the attribute change timestamp (when restored) and the last access timestamp; 2012-08-30 - Updated pgm COMPILE, to remove undue libraries from the system library list. 2012-08-17 - Added subprocedure ChkIfsObj4. It reports IFS object size in a 64 (instead of 32) bit binary field. 2012-06-26 - Added one optional parameter to subprocedures UrlEscSeq and UrlUnescSeq, see page http://www.easy400.net/cgidev2o/exhibit5.htm#1a 2012-05-09 - Fixed a bug in CGIDEV2/XXXCGIPARS. This bug was not allowing to upload a file, if the name of the input variable associated to the browse button had a length lower than 9. 2012-04-27 - Fixed program CGIDEV2/CRTCGISRC. 2012-04-18 - Replaced module XXXRANDOM of CGISRVPGM2 with the version fixed by Rich Diedrich in 2006. 2012-04-09 - Fixed a wrong GOTO in QCLSRC/CRTSRVPGM installation procedure. 2012-03-21 - It was found that CGIDEV2 supports a maximum of 50 output variables in a HTML row. This restriction was due to local subprocedure "SetupArrays" in module XXXWRKHTML. That has been modified in order to support up to 500 output variables in a HTML row. 2012-02-07 - "HttpOnly" flag now supported by subprocedure CrtCookie. See page http://www.easy400.net/cgidev2o/exhibiu8.htm 2012-01-12 - Fixed pgms DSPSRC and BOATSCH2. 2012-01-06 - Service program CGIDEV2 has now activation group CGIDEV2 (previously it was *CALLER). - Added comments on deallocating memory after ZhbGetVarPtr . 2011-12-25 - Added command DUPSRVPGM. This command may help in updating CGI programs after installation of a new CGIDEV2 release. See page http://www.easy400.net/cgidev2o/tutorial.htm#10 . 2011-12-22 - Provided subprocedure DECODE2 (convert entities to characters), the opposite of subprocedure ENCODE2. - Named entities conversion table (/cgidevexthtml/encode2Fil.txt) already existed. - Now provided a conversion table also for decimal entities (/cgidevexthtml/encode2Fil2.txt). 2011-12-16 - Replaced many OVRDBF commands with File-description keyword EXTFILE. 2011-11-22 - Updated ZIP and UNZIP commands to the latest version of utility ZIP (library ZIP). 2011-11-02 - Some changes to pgm DSPSTMF in order to support file extensions other than PDF, HTML, HTM, TXT. 2011-10-25 - Added a program (DSPSTMF) to display a stream file without letting the user know its path. See page http://www.easy400.net/cgidev/html/faq41.htm . 2011-09-25 - Added subprocedure CvtStmf (Convert a stream file to another CCSID) and command STMFCVT. - Fixed program SETCGILIB to handle also UTF (CCSID 1208) HTTP configuration files. 2011-09-21 - Fixed subprocedure AppHtmlToStmf() (Append HTML to Stream file) in module XXXWRKHTML in order to support also Unicode (CCSID 1208) stream files. - Fixed program FAQ38A. 2011-09-15 - Made available a PDF version of the CGIDEV2 Tutorial. 2011-09-09 - Updated some FAQ's. 2011-08-17 - Added subprocedure AppHtmlToStmf() (Append HTML to Stream file) in module XXXWRKHTML. See page http://www.easy400.net/cgidev2o/exhibiu7.htm#apphtmltostmf . 2011-08-02 - Some users on V5R2 and on V5R4 reported problems with subprocedure GETHTML in source member XXXWRKHTML. Sometimes it seems to load a source member different from the requested one. A fix was applied to the OVRDBF command preceeding the OPEN of the file member, and it seems to work. 2011-07-27 - Some navigation improvements in CGIDEV2 tutorial. 2011-07-25 - Added some monitor code to subprocedure ClrHtmlBuffer in module XXXWRKHTML. If memory re-allocation fails, the HTTP CGI job servicing the request is ended. - In subprocedure ZhbGetInput of module xxxCGIPARS, pointers wkP and wkSaveP changed from static to dynamic and the "Entry data workarea" pointed by WkP is deallocated before returning. 2011-03-27 - Added subprocedure ChkIfsObj3 to module XXXIFS. Subprocedure ChkIfsObj3 provides more information than subprocedure ChkIfsObj2 about a given IFS object. The following information can be retrieved: object type, object size, creation timestamp, codepage, CCSID. 2011-03-25 - Provided support for Unicode (CCSID 1208) stream files in subprocedure GetHtmlIfsMult (module XXXWRKHTML). - Added module XXXCVTSTG (Convert string) to service program CGISRVPGM2. - In subprocedure WrtHtmlToStmf (module XXXWRKHTML) forced ClrHtmlBuffer before returning. 2011-03-22 - Fixed local subprocedure RtvPgmStack in source members XXXCGIPARS, XXXCOOKIE, XXXDATA, XXXDEBUG, XXXUSRSPC, and XXXWRKHTML. 2011-03-07 - Fixed bug in subprocedure LoadStreamFile. 2011-03-24 - Subprocedure ZhbGetVarLower added to module XXXCGIPARS. See page http://www.easy400.net/cgidev2o/exhibit2.htm . - Subprocedure LowFy added to module XXXDATA. See page http://www.easy400.net/cgidev2o/exhibit5.htm#lowfy . - Subprocedures GetHtml, GetHtmlIfs and GetHtmlIfsMult now run subprocedure SetJobCCSID as soon as they start. This is intended to overcome problems on boxes running with system value QCCSID equal to 65535. - Subprocedure SetJobCCSID added to module XXXJOB. If the current job CCSID is 65535, this subprocedure sets it to the job default CCSID value, provided that data area CGIDEV2DT/SETJBCCSID contains '*YES'. - Subprocedure LoadStreamFile added to module XXXIFS. See page http://www.easy400.net/cgidev2o/exhibiV2.htm#loadstmf 2011-02-25 - Small change in XXXCGIPARS (for file upload): added flag O_INHERITMODE when creating stream file. 2011-01-28 - Small changes in XXXCGIPARS (for file upload) and in pgm REBIND (option(*dupproc)). 2011-01-19 - Fixed a small bug in script CGIDEV2/DEMOHTMLIT, member DEMOS. 2011-01-13 - Updated pgm CCSIDSRCF, so that at installation time sources are converted to the default job CCSID if job CCSID = 65535. 2011-01-11 - In module XXXWRKHTML added O_INHERITMODE flag when creating the stmf in procedure WrtHtmlToStmf. In this way the stmf receives the same data authorities as the parent directory. 2010-11-25 - Added HTTP header "Expires: 0" to the external HTML of CGI COOKIE2 to avoid local cash problems. - Found that a port number should never be specified in the Domain parameter of the Set-Cookie header. 2010-11-21 - Added command CGIDEV2/UPDALWEXT. This command makes it easy to maintain the list of client extensions allowed for the client side validation script of sample program UPLOAD. For detail information, see page http://www.easy400.net/cgidev/html/exhibiv3.htm#validation 2010-11-18 - Added an exit point to subprocedure ZhbGetInput (module XXXCGIPARS). The exit point may be used to call a validation user program when a file upload is processed. For detail information, see page http://www.easy400.net/cgidev/html/exhibiv3.htm#validation 2010-04-30 - Command CGIDEV2/SETCGILIB no longer duplicates service program CGISRVPGM2 and binding directory TEMPLATE2 from library CGIDEV2 to the user library(ies). It now also creates an IFS directory (and some subdirectories) with a name same as the production library. The way an Apache HTTP instance is updated, has been changed. - Program CGIDEV2/INSTALL, when restoring the IFS directory /cgidev , now will use paramer OPTION(*NEW) not to clobber any changes made by the installer on existing objects. - Module XXXCGIPARS has been updated in order to care for data passed from older browsers, when a file upload is requested. 2010-01-10 - Member QRPGLESRC/XXXDATA1 Added subprocedure UrlUnEscSeq. 2009-11-03 - Member QRPGLESRC/XXXWRKHTML It was found that the fix for error message TCP7531 ("output buffer damaged" when executing subroutine WRTBUFFER on a WRTSECTION('*FINI')), fix dated 2008-12-18, was not working properly. Error fix: The request to end the HTTP server job is now submitted through a bach job with name ENDCGIJOB. Note that the time needed for ending the job depends from the value specified in system value QENDJOBLMT. 2009-06-15 - Fixed a bug in the subprocedure uploading PC files (See 2009-05-21). When uploading large files (over 70 Mb), chances were that x'0d25' could be converted to x'0020'. Also CPU usage significantly lowered. Ron Egyed, June 14, 2009. 2009-06-12 - Added commands ZIP and UNZIP in library CGIDEV2. 2009-06-01 - Fixed a bug in the subprocedure uploading PC files (See 2009-05-21). The bug was related to MS Internet Explorer browser. While Firefox for the name of the file to be uploaded transmits only the file name, I.E. transmits also the path (e.g. C:\aaa\bbb\ ) ahead of the file name. This path was incorrectly added to the name of the IFS stream file created in directory /tmp 2009-05-29 - Subprocedure GetHtmlIfsMult loads external script files into "records" by trimming right the record string. This, while is good for performance (useless blanks are not transmitted to the browser), can damage the output when it is going to be written to a stream file via subprocedure WrtHtmlToIfs, exspecially when the script loaded is a kind of XML document. Therefore, the trimming right operation is now performed only if the external file being loaded has one of the following extensions: html, htm, text or txt. 2009-05-21 - Added a feature to subprocedure zhbGetinput. This feature allows to upload PC files. Documented at page http://www.easy400.net/cgidev/html/exhibiv3.htm The code was developed by Ron Egyed, RJE Consulting Inc, New Port Richey (FL), U.S. 2009-05-06 - Changed the Open()'s in subprocedure WrtHtmlToStmf of module XXXWRTHTML in order to support UTF-8 and UTF-16. That was done according to the suggestion by Scott Klement in the Easy400Group posting number 10335 dated Mon Oct 1, 2007 7:52 pm. 2009-04-14 - Added subprocedure GetHtmlBufferP to module XXXWRTHTML. Returns a pointer to the HTML output buffer and its used length. See page http://www.easy400.net/cgidev2o/exhibit4.htm#buffp . 2009-03-25 - Added module XXXJOB to service program CGISRVPGM2. It includes two new subprocedures: - "GetActJob" Get a list of Active Jobs to file QTEMP/JOBLIST - "GetNEndJob" Get a list of Not Ended Jobs to file QTEMP/JOBLIST CGISRVPGM2 service program signature set to zero (no level check any longer) - Added command EDBG (Enhanced Debug). It allows a quicker start debugging. 2009-02-18 - Added module XXXDATA1 to service program CGISRVPGM2. It includes the new subprocedure "UrlEscSeq". 2009-01-09 - All XXX... modules, when calling WRTDEBUG procedure, will now - if appropriate - state the qualified name of the job and the qualified name of the program asking for a service. 2008-12-18 - Member QRPGLESRC/XXXWRKHTML Fixed an error reported by the Easy400Group several times in 2008. Error description: If a CGI job is kept under debugging for too much time after writing something in the output buffer, the CGI request ends up with ERROR 500 to the browser and any subsequent attempt from the same job to send the output buffer (for instance via section *fini) receives error message TCP7531. The only way out is to end the CGI job or restart the related HTTP instance. Error fix: Subprocedure WRTSECTION, subroutine WRTBUFFER, if receiving error TCP7531, now ends the CGI job. - All XXX... modules, when calling WRTDEBUG procedure, will now - if appropriate - state the qualified name of the program asking a service. 2008-04-16 - Member QRPGLESRC/XXXWRKHTML A new version of this member incorporates a change suggested to the Easy400Group in March 2008 in order to overcome a problem with subprocedure WrtHtmlStmf. The problem was in scanning for a new line character. >>>>The new code operates on the HTML output buffer one byte at a time, >>>>copying each byte to the work buffer unless the byte is a newline character >>>>(x'15') in which case it writes CRLF (x'0D25'). 2007-10-22 - Command SETCGILIB RPG module SETCGILIB5 changed the way the APACHE target configuration file is updated. That was done to overcome failure of command CPYFROMSTMF due to inability to convert to target CCSID. ... ... ... 2003-12-10 - Command cgidev2/cgisetup now allows to select the type (original or Apache) of HTTP directives to be generated. 2003-09-03 - A major refresh including . New methods to store and retrieve "program state" information using user spaces. This methods provide an extended support for improving CGI persistancy, without having to use persistent-CGI. . New subprocedures . Some important fixes . APACHE directives for running CGIDEV2 2003-07-18 - A fix to subprocedure CRTCOOKIE 2003-05-21 - New features: . Input buffer substantially increased . reduced HTML output stream when using IFS external HTML . small redesign of CGIDEBUG file 2003-04-04 - New FAQ's: . How can a CGI respond with a document? . Is it there any utility that would allow me to upload IFS objects? . How can I link from an HTML page to a page generated from IBM WebFacing tool? . How can I tell the HTTP server not to search the whole IFS for an image that is not found? 2002-07-30 - A new version of CGIDEV2 has been made available. Module XXXCGIPARS of service program CGISRVPGM2 was fixed to s properly support HTML variable names up to 50 characters long. 2002-05-17 - Fixes and enhancements: . The main problem fixed was subprocedure crtCookie not able to create cookies for a national language other than English. . New subprocedure getHtmlBytesBuffered was made available. 2002-04-04 - Fixes since release dated 2001-11-20. 2001-11-20 - Refresh. 2001-11-08 - Refresh containing the following fixes: . Subprocedure "getCookie" had problems when no client cookie available . Command "setCgiLib" was generating duplicated entries in binding directory "template2". 2001-10-02 - Command CGIDEV2/CRTCGISRC has been reworked to provide a running example of a simple CGI managing both the input from and the output to a client. It now includes also the generation of the an external HTML source. It requires command "cgidev2/setcgilib" be run again if the library was already existing. 2001-09-28 - Major CGIDEV2 refresh available. It includes new important subprocedures for . Loading external HTML from multiple IFS files . Managing cookies from the CGI programs 2001-06-01 - New refresh of library cgidev2. It includes . the ability to clear the CGIDEBUG file without stopping the HTTP server . the ability to handle up to 8,200 occurrences of the same input variable (the previous limit was 250). . This applies to the CgiVarCnt, CgiVarVal, and CgiVarValUpper subprocedures. ZhbGetVarCnt, ZhbGetVar, and ZhbGetVarUpper have no practical limit. 2001-05-14 - New refresh of library cgidev2. It includes . Some fixes related to the management of the CGIDEBUG file . The additional CGIDEBUG subprocedure setNoDebug which removes all debug activities from a program, for optimum performance. . The new subprocedure wtrHtmlToStmf which allows to save the html output buffer to an IFS stream file. This allows t This allows to generate static pages from dynamic processes. In some cases this allows to greatly improve response times, while decreasing the machine load. 2001-03-06 - CGI service program cgisrvpgm2 now allows to load the external HTML scripts also from IFS stream files. This has some advantages: . HTML authoring tools can now be used to develop dynamic pages . Code page potential problems experienced with source file members should be lowered 2001-02-14 - CGI WEB Demo "Boats" from Giovanni now available with CGIDEV2. 2001-01-15 - A refresh of library cgidev2 (version 2 of Mel Rothman's CGI service program) is available. It includes a number of small fixes, tutorial updates, and new versions of commands setcgilib and crtcgisrc. The new versions allow to create RPG CGI skeleton programs selecting among three sets of procedures for reading the input string and for parsing the input string. 2000-12-21 - A new release (Version 2) of Mel Rothman's CGI service program (library cgidev2) is now available for download. It features: . a superior performance (5 to 10 times better) . better coding facilities . some new functions Please note that it requires OS/400 release V4R3M0 or subsequent. Upgrades from CGIDEV to CGIDEV2 can be easily done. CENTAUR demo is also available for Version 2 (library centaur2). We plan to make all deliverables available under Version 2 by the end of February 2001. We plan to make italian texts available by the end of March 2001. Please note that Version 1 deliverables, though frozen, will remain available.