C

eval

alpha1=%subst(c:i:1)

C

select

 

C

when

alpha1='-'

C

eval

sign= -1

C

when

alpha1='.'

C

eval

indecimal='1'

C

when

alpha1 >='0' and alpha1 <= '9'

C

eval

wknum = wknum * 10 + number1

C

if

indecimal = '1'

C

eval

decpos = decpos + 1

C

endif

 

C

endsl

 

C

enddo

 

C

eval

n = wknum * sign / 10 ** decpos

C

return

n

Pc2n

E

 

**************************************************************************

*Compile-time array follows:

**************************************************************************

*A line MUST follow Content-type with only a single newline(x'15'). If

*this newline does not exist, Then NO data will be served to the client.

*This newline represents the end of the HTTP header and the data follows.

**CTDATA HTML Content-type: text/html

<html>

<head>

<title>Sample AS/400 RPG program executed by HTTP Server as a CGI</title> </head>

<body>

<h1>Sample AS/400 RPG program.</h1> <br>

<br>

<p>This is sample output using AS/400 HTTP Server CGI APIs from an RPG program. This program reads the input data from Query_String environment variable when the Request_Method is GET and reads standard input when the Request_Method is POST.

<p>Server input:<br>

<p>Environment variable - REQUEST_METHOD:

<p>Environment variable - SERVER_SOFTWARE:

</body>

</html>

Example of a C language server configuration API program

/*

This C source file is for compiling into the sample program APISAMPLE.PGM. It invokes the new configuration file APIs contained in SRVPGM QHTTPSVR/QZHBCONF to read in

a configuration file, and either replace an existing PORT directive or to add a new one.

This code is written by IBM, and is intended only as a sample. There is no implied support for this code, and it is not

a part of any IBM product. It can be freely copied, modified and used in any way desired.

*/

#include <stdio.h>

Chapter 6. Sample programs (in Java, C, and RPG) 105

Page 115
Image 115
IBM AS/400E manual Example of a C language server configuration API program

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.