Note: You will probably need additional authority to troubleshoot the CGI program. For example, you will probably need authority to the QTMHHTTP user profile.

c.Set breakpoints in the program.

d.On the browser, issue a URL that would run the CGI program.

The Pass and Exec directives that request the document and run a CGI program must be in WRKHTTPCFG.

e.After the system issues an HTTP request on the browser, return to the AS/400 session that ran STRSRVJOB. It should have stopped at a program breakpoint.

Ending and starting the server ensures that only one worker thread is running.

3.When finished with debug, reset the server values:

a.Issue the command ENDDBG

b.Issue the command ENDSRVJOB

c.Issue the command WRKACTJOB SBS(QHTTPSVR) JOBserver_instance

d.Issue the command STRTCPSVR *HTTP HTTPSVR(server_instance

Symptom

The system is not converting or handling special characters as expected.

Cause: The browser inserts special characters using escape sequences which requires special handling by the CGI program.

Solution: Browsers create escape sequences (ISO 8859) for special characters (for

example, : . , ! @ # $ % *, and so on.) These characters come into standard input or into the QUERY_STRING environment variable in the form “%xx”, where “xx” is the two characters representing the ASCII hexadecimal value. (For example, a comma comes in as “%2C”. For CGI input mode %%MIXED%%, these three characters “%xx” are converted to EBCDIC, but the values of “xx” are not changed to the corresponding EBCDIC code points.

There are two approaches to handling escape sequences:

1.Convert the EBCDIC representation of the ASCII escape sequence to an EBCDIC escape sequence or use CGI input mode %%EBCDIC%%. This is necessary because the QtmhCvtDB API assumes that escape sequences represent EBCDIC code points, and the API converts them to the corresponding EBCDIC character. For example, %2C, which represents an ASCII comma, is converted to EBCDIC X'2C', which is not an EBCDIC comma.

2.Convert the EBCDIC representation of the ASCII escape sequence to the EBCDIC equivalent character.

The following approach outlined in the first conversion technique listed above:

Note: The hex representation of the %2C from the browser was 0x253243. When this escape sequence is converted to EBCDIC, it ends up as 0x6CF2C3.

1.Convert the “xx” in “%xx” to the corresponding EBCDIC character. In this case 0xF2C3 is converted to 0x2C.

2.For the first approach, convert the EBCDIC character to the two-byte form. Then you can reinsert the two bytes back into the input stream in the same

Chapter 10. Troubleshooting your CGI programs 141

Page 151
Image 151
IBM AS/400E manual Troubleshooting your CGI programs

AS/400E specifications

The IBM AS/400E, now more commonly known as IBM i, is a robust and versatile midrange server that has been designed to provide a comprehensive computing solution for businesses of all sizes. First introduced in the late 1980s, the AS/400 series has undergone multiple enhancements and rebranding, with the AS/400E being one of the notable iterations. This powerful platform is closely associated with IBM's commitment to reliability, scalability, and integrated business solutions.

One of the main features of the AS/400E is its highly integrated architecture that combines hardware and software into a cohesive system. This integration allows for seamless operations, reducing the complexity typically associated with managing disparate systems. The system is powered by IBM's proprietary OS/400 operating system, which has evolved into IBM i, featuring advanced capabilities like object-oriented programming, integrated database management, and security features that are essential for enterprise environments.

A key characteristic of the AS/400E is its robust database support, primarily through the use of DB2 for i. This integrated database management system enables efficient data handling and retrieval, facilitating real-time business analytics and reporting. Furthermore, the platform supports a variety of programming languages, including RPG, COBOL, and Java, making it flexible for developers who require diverse tools for application development.

The AS/400E is also known for its exceptional reliability and uptime, making it a preferred choice for critical business applications in industries such as finance, healthcare, and manufacturing. This reliability is backed by advanced error detection and correction mechanisms, as well as redundancy features that help prevent data loss and minimize downtime.

In terms of scalability, the AS/400E can effortlessly expand to accommodate growing business demands. Organizations can increase processing power by adding more resources without significant disruption. This scalability, combined with the system’s built-in virtualization capabilities, allows businesses to optimize resource usage and streamline operations.

Security is another defining feature of the AS/400E. The platform incorporates various layers of security measures, including user authentication, encryption, and comprehensive auditing capabilities, ensuring that sensitive business data is protected against unauthorized access.

Overall, the IBM AS/400E remains a powerful tool in the enterprise computing landscape, providing businesses with an integrated, reliable, and secure solution for their technological needs. Its enduring popularity is a testament to its capability to evolve with changing business requirements while maintaining its core attributes of high performance and stability.