The three ways to define variables in a Net.Data macro are:
The simplest way to define a variable for use in a Net.Data macro is to use the DEFINE statement. This syntax is specific to Net.Data:
%DEFINE variable_name="variable value"
%DEFINE variable_name={ variable value on multiple
lines of text %}
The variable_name is the name you give the variable. Variable names must begin with a letter or underscore and can contain any alphanumeric characters or an underscore. All variable names are case-sensitive, except N_columnName and V_columnName, which are table variables.
To include quotes in a string, use two quotes consecutively. Two consecutive quotes alone is equal to a null string. For example:
%DEFINE HI="say ""hello"""
The variable HI displays say "hello".
%DEFINE reply="hello"
The variable reply displays hello,
%DEFINE empty=""
The variable empty is null.
To define several variables with one DEFINE statement, use a DEFINE block:
%DEFINE{
variable1="value1"
variable2="value2"
variable3="value3"
variable4="value4"
%}
You can use the SELECT and INPUT tags used for an HTML form. The following example uses standard HTML form tags to define a variable:
<INPUT NAME="variable_name" TYPE=...>
or
<SELECT NAME="variable_name">
The variable_name is the name you give the variable, and the value of the variable is determined from the input received in the form. See HTML Forms for an example of how this type of variable definition is used in a Net.Data macro.
A variable value received from an INPUT or SELECT tag overrides a variable value set by a DEFINE statement in a Net.Data macro.
You can call Net.Data macros as URL requests and include variables, such as a user ID, in the URL to send to Net.Data. For example:
http://www.ibm.com/cgi-bin/db2www/stdqry1.d2w/input?field=custno
In the above example, the variable name, field, and the variable value, custno, specify additional data that Net.Data receives from the input statement. Net.Data receives and processes the data as it would form data.