/* before writing any html text. This indicates the end of the

*/

/* header and the start of text that is served from the server.

*/

/* This text is usually html but can be plain/text.

*/

/*

 

*/

/* Input: Data read from standard input or QUERY_STRING that is

*/

/*

entered in an HTML form.

*/

/*

 

*/

/* Output: The data read from standard input is written as is to

*/

/*

standard output. This information would then be served by */

/*

the HTTP server.

*/

/*

 

*/

/* Exit Normal:

*/

/*

 

*/

/* Exit Error: None

*/

/*

 

*/

/**********************************************************************/ void main()

{

char

*stdInData;

/* Input buffer.

*/

char

*queryString;

/* Query String env variable

*/

char

*requestMethod;

/* Request method env variable */

char

*serverSoftware;

/* Server Software env variable*/

char

*contentLenString;

/* Character content length.

*/

int

contentLength;

/* int content length

*/

int

bytesRead;

/* number of bytes read.

*/

int

queryStringLen;

/* Length of QUERY_STRING

*/

/*------------------------------------------------------------------

 

*/

/* The "Content-type" is the minimum request header that must be

*/

/* written to standard output.

It describes the type of data that

*/

/* follows.

 

*/

/*------------------------------------------------------------------

 

*/

printf("Content-type: text/html\n");

 

/*------------------------------------------------------------------

 

*/

/* VERY IMPORTANT! An extra newline must be written

*/

/* after the request header.

In this case the request header is

*/

/* only the Content-type. This tells the HTTP server that the

*/

/* request header is ended and the data follows.

*/

/*------------------------------------------------------------------

 

*/

printf("\n");

 

 

/*------------------------------------------------------------------

 

*/

/* This html text consists of a head and body section. The head

*/

/* section has a title for the document. The body section will

*/

/* contain standard input, QUERY_STRING, CONTENT_LENGTH,

*/

/* SERVER_SOFTWARE and REQUEST_METHOD.

*/

/*------------------------------------------------------------------

 

*/

printf("<html>\n");

 

 

printf("<head>\n");

 

 

printf("<title>\n");

 

 

printf("Sample AS/400 HTTP Server CGI program\n");

 

printf("</title>\n");

 

 

printf("</head>\n");

 

 

printf("<body>\n");

 

 

printf("<h1>Sample AS/400 ILE/C program.</h1>\n");

 

printf("<br>This is sample output writing in AS/400 ILE/C\n"); printf("<br>as a sample of CGI programming. This program reads\n"); printf("<br>the input data from Query_String environment\n"); printf("<br>variable when the Request_Method is GET and reads\n"); printf("<br>standard input when the Request_Method is POST.\n");

/*------------------------------------------------------------------

*/

/* Get and write the REQUEST_METHOD to stdout.

*/

/*------------------------------------------------------------------

*/

requestMethod = getenv("REQUEST_METHOD");

 

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

Page 107
Image 107
IBM AS/400E manual Sample programs in Java, C, and RPG

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.