IBM Books

Reference

INCLUDE_URL Statement

Purpose

Reads and incorporates another file into the Net.Data generated output in which the statement is specified. The specified file can exist on a local or remote server.

Using the INCLUDE_URL statement, you can invoke one macro from another macro without requiring the application user to select a Submit button.

Net.Data executes an INCLUDE_URL statement only once when processing the macro and inserts the content of the included file at the location of the INCLUDE_URL statement in the macro. Any variable references in the name of the included file are resolved at the time the INCLUDE_URL statement is first executed, not when the content of the included file is to be executed.

When an INCLUDE_URL statement is in a ROW or WHILE block, Net.Data does not repeatedly execute the INCLUDE_URL statement. Net.Data executes the INCLUDE_URL statement the first time it executes the ROW or WHILE block, incorporates the content of the included file into the block, and then repeatedly executes the ROW or WHILE block with the content of the included file.

Syntax

                       .-------------------------.
                       V                         |
>>-%INCLUDE_URL---"------+-string-------------+--+--"----------><
                         '-variable reference-'
 

Values

%INCLUDE_URL
The keyword that indicates that a file is to be read and incorporated into the Net.Data macro from the local or a remote server.

string
Any sequence of alphabetic and numeric characters and punctuation, except the new-line character.

variable reference
Returns the value of a variable and is specified with $ and (). For example: if VAR='abc', then $(VAR) returns the value 'abc'. See Variable Reference for syntax information.

Context

INCLUDE_URL statements can be found in these contexts:

Restrictions

INCLUDE_URL statements can contain these elements:

On OS/390, the INCLUDE_URL file can be up to 256 KB. Other operating systems do not have a limit.

When using the INCLUDE_URL statement, do not start an infinite sequence of macro requests by invoking the current macro recursively.

INCLUDE_URL is not supported in the OS/400 environment.

Examples

Example 1: Including an HTML file from another server

 %include_url "http://www.ibm.com/path/myfile.html"

Example 2: Including an HTML file from a remote server by calling the server name

 %include_url "myserver/path/myfile.html"

Where myserver is the server name.

Example 3: Including an HTML file from the local Web server

 %include_url "/path/myfile.html"

Tip: By using this method, you do not have to update the INCLUDE_URL path in the Net.Data configuration file to specify directories that are already known to the Web server. If the string does not begin with a slash, Net.Data assumes the string is a server name and attempts to retrieve the file from the server with the corresponding name.

Example 4: Including other Net.Data macros from a remote server

%REPORT{
<P>Current hot pick as of @DTW_rTIME():
%include_url "http://www.ibm.com/cgi-bin/db2www/hotpic.mac/report?custno=$(custno)"

In this example, the macro hotpic.mac is called and custno is sent as a variable. If the string begins with a slash, Net.Data retrieves the INCLUDE file from the local Web server.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]