Chapter 3. Using Net.Data to Write CGI Programs for You
This chapter discusses Net.Data for AS/400.
Net.Data is an application that runs on a server and allows you to easily create
dynamic web documents that are called web macros. Web macrosthat are created
for Net.Data have the simplicity of HTML with the functionality of CGI-BIN
applications. Net.Data makes it easy to add live data to static web pages. Live data
includes information that is stored in databases, files, applications, and system
services.

Overview of Net.Data

Net.Data is a comprehensive web development environment for the creation of
simple dynamic web pages or complex web-based applications. These applications
enable browser clients to access data from a variety of sources, such as databases,
applications, and system services.
Net.Data consists of a program, the web macro processor, and one or more
dynamic libraries, called language environments. The executable input to Net.Data
is the web macro.
The web macro processor communicates with IBM HTTP Server through its
CGI-BIN interface. The server uses TCP/IP to connect to the Internet. Like other
CGI-BIN programs, Net.Data is typically stored in the servers CGI-BIN directory.
Net.Data is accessed when a URL received by the server refers to the web macro
processor operable, DB2WWW, in the CGI-BIN directory.
Language environments are the web macro processors interface to your data and
applications. Each language environment provides a specific interface to a
particular resource. For example, Net.Data provides language environments to
access DB2
®
databases, REXX, and other applications via the SYSTEM language
environment.
A web macro is a file that contains a series of statements that are defined by the
Net.Data web macro language. These statements can include standard HTML and
language environment-specific statements (for example, SQL statements) as well as
macro directives. These statements act as instructions to the web macro processor,
telling it how to construct dynamic web pages.
When a URL is received by the server that refers to the web macro processor
program, the server starts an instance of the web macro processor. It then passes
essential information, including the name of the requested web macro and the
section of the macro to use. The web macro processor then:
1. Reads and parses through the web macro
2. Interprets all the macro statements, and
3. Dynamically builds the HTML page
When a web macro language %FUNCTION statement is encountered, the web
macro processor loads the requested language environment-dynamic library
(service program). It then passes language-specific information to the language
© Copyright IBM Corp. 1997, 2000 79