#include <stdlib.h>

 

 

#include <qusec.h>

/* For errcode structure */

#include <qzhbconf.h>

/* For group file API's */

int main (int argc, char **argv)

 

{

 

 

Qus_EC_t errcode;

 

/* Error code structure */

unsigned char configname10[10];

/* Config name */

unsigned int cfghdl;

 

/* Handle for config file */

unsigned int getlock = 1;

/* Argument to request a write lock */

unsigned char valstr[100];

/* Value string argument */

unsigned int vallen;

 

/* Length argument */

unsigned int numtofind = 0;

/* Will be searching for last directive */

unsigned int casesense = 0;

/* Case insensitive search */

unsigned int writecfg = 1;

/* Write config back out */

unsigned int dirhdl;

 

/* Handle for a directive */

if (argc <= 2 strlen(argv[1]) > 10 atoi(argv[2]) < 1) { printf("usage: call lib/prog 'configname' 'portnumber'\n"); return 1;

}

/* Get config name into a 10 character format */

strncpy((char *) configname10, " ", 10); strncpy((char *) configname10, argv[1], strlen(argv[1]));

/* Set up error code structure */ errcode.Bytes_Provided = sizeof(Qus_EC_t);

/* Open the config - program will end if error occurs */ QzhbOpenConfig(configname10, &getlock, &cfghdl, NULL);

/* Search for the last PORT directive in the file */ strcpy((char *) valstr, "port");

vallen = strlen((char *) valstr); QzhbFindDirective(&cfghdl, valstr, &vallen, NULL,

&numtofind, &casesense, &dirhdl, (unsigned char *) &errcode);

/* Build string containing what we want the PORT directive to look like */ sprintf((char *) valstr, "Port %s", argv[2]);

vallen = strlen((char *) valstr);

/* If found a PORT directive, replace it with our new value */ if (errcode.Bytes_Available == 0) {

/* Replace existing directive, letting error end the program */ QzhbReplaceDirective(&cfghdl, &dirhdl,

valstr, &vallen, NULL);

printf("Replaced existing PORT directive in configuration %s with: %s\n", argv[1], valstr);

}

/* If did not find the PORT directive, we want to add a new one */ else {

unsigned int insertpos = 4; /* Automatic positioning */ /* Add new directive, letting error end the program */

QzhbAddDirective(&cfghdl, valstr, &vallen, &insertpos, NULL, &dirhdl, NULL);

printf("Added new PORT directive in configuration %s as: %s\n", argv[1], valstr);

106Web Programming Guide V4R5

Page 116
Image 116
IBM AS/400E manual Web Programming Guide V4R5

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.