These variables are Net.Data-defined variables that you can use to affect Net.Data processing, find out the status of a function call, and obtain information about the result set of a database query, as well as determine information about file locations and dates. You might find these variables useful in functions you write or use them when testing your Net.Data macros.
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Purpose
The name and extension of the current input file. The input file is either a Net.Data macro or a file specified in an INCLUDE statement.
This variable is a predefined variable and its value cannot be modified. Use the variable as a variable reference.
Examples
<P>This file is <I>$(DTW_CURRENT_FILENAME)</I>, and was updated on $(DTW_CURRENT_LAST_MODIFIED).
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Purpose
The date and time the current file was last modified. The current file can be a Net.Data macro file or a file specified in an INCLUDE statement. The output format is determined by the system on which Net.Data runs.
This variable is a predefined variable and its value cannot be modified. Use the variable as a variable reference.
Examples
<P>This file is <I>$(DTW_CURRENT_FILENAME)</I>, and was updated on $(DTW_CURRENT_LAST_MODIFIED).
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
|
|
|
|
| X |
|
|
|
Purpose
Contains the message text returned from a call to a built-in function or to language environment when an error occurs.
You can use the DTW_DEFAULT_MESSAGE variable in any part of the Net.Data macro file.
This variable is a predefined variable, it is not recommended to modify its value. Use the variable as a variable reference.
Examples
Example 1: A message stating whether the function completed successfully
@function1()
%IF ("$(RETURN_CODE)" == "0")
The function completed successfully.
%ELSE
The function failed with the return code $(RETURN_CODE). The error message
returned is "$(DTW_DEFAULT_MESSAGE)".
%ENDIF
Example 2: The default text for when a function returns a non-zero return code
%MESSAGE{
default: {<h2>Net.Data received return code: $(RETURN_CODE).
Error message is $(DTW_DEFAULT_MESSAGE)</h2> %} : continue
%}
The user sees the default error message, if a function returns a return code other than 0.
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X |
|
| X | X | X |
Purpose
The level of messages that Net.Data writes to the log file.
You can specify the value of this variable using a DEFINE statement or with the @DTW_ASSIGN() function.
Requirement: Define DTW_LOG_DIR in the Net.Data initialization file to initiate logging; otherwise Net.Data does not log messages when you specify the DTW_LOG_LEVEL variable in the macro file.
Values
DTW_LOG_LEVEL="OFF|ERROR|WARNING"
Table 22. DTW_LOG_LEVEL Values
| Values | Description |
|---|---|
| OFF | Net.Data does not log errors. OFF is the default. |
| ERROR | Net.Data logs error messages. |
| WARNING | Net.Data logs warnings, as well as error messages. |
Examples
%DEFINE DTW_LOG_LEVEL="ERROR"
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Purpose
The name and extension of the current Net.Data macro file.
This variable is a predefined variable and its value cannot be modified. Use the variable as a variable reference.
Examples
<P>This Net.Data macro is <I>$(DTW_MACRO_FILENAME)</I>, and was updated on $(DTW_MACRO_LAST_MODIFIED).
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Purpose
The date and time the Net.Data macro was last modified. The output format depends on the system on which Net.Data runs.
This variable is a predefined variable and its value cannot be modified. Use the variable as a variable reference.
Examples
<P>This Net.Data macro is <I>$(DTW_MACRO_FILENAME)</I>, and was updated on $(DTW_MACRO_LAST_MODIFIED).
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Purpose
The path and name of the Net.Data executable file. Depending on your system, the output looks like the following sample path and name:
/usr/lpp/internet/server_root/cgi-bin/db2www
This variable is a predefined variable and its value cannot be modified. Use the variable as a variable reference.
Examples
The Net.Data executable file is $(DTW_MP_PATH).
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Purpose
The version and release number of Net.Data running on the server. The output is in the following format:
Net.Data Version 2.1
This variable is a predefined variable and its value cannot be modified. Use the variable as a variable reference.
Examples
This Web application uses $(DTW_MP_VERSION).
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Purpose
Specifies text for the HTTP header.
You must have this variable set before Net.Data processes any text sent to the Web browser, because Net.Data reads this variable once before displaying text and does not look at it again. Any changes to the DTW_PRINT_HEADER variable are ignored after Net.Data has sent text to the browser.
If you are using DTW_PRINT_HEADER to generate your own headers (DTW_PRINT_HEADER="NO"), you must set DTW_REMOVE_WS="NO".
Specify the value of this variable using a DEFINE statement or with the @DTW_ASSIGN() function.
Values
DTW_PRINT_HEADER="YES"|"NO"
Table 23. DTW_PRINT_HEADER Values
| Values | Description |
|---|---|
| YES | Net.Data prints out the text Content-type: text/html for the HTTP header. YES is the default. |
| NO | Net.Data does not print out an HTTP header. You can generate custom HTTP header information. |
Examples
One of the most common uses of this variable is to enable Net.Data macros to send cookies. To set a cookie, the DTW_PRINT_HEADER variable must be set to NO, and the first three lines must be the Content-type header, the Set-Cookie statement, and a blank line.
Example 1: Enabling Net.Data to send a cookie
%DEFINE DTW_PRINT_HEADER="NO"
%HTML(cookie1) {
Content-type: text/html
Set-Cookie: UsrId=56, expires=Friday, 12-Dec-99, 12:00:00 GMT; path=/
<P>
Any text
%}
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Purpose
Reduces the size of a dynamically generated Web page by compressing extra space caused by tabulators, white space, and new-line characters.
Specify the value of this variable in the DEFINE block.
Using <PRE></PRE> tags: Defining this variable to YES affects the amount and type of white space that is printed. If the variable is set to YES, portions of HTML pages that use <PRE></PRE> tags might not display as intended.
If you are using DTW_PRINT_HEADER to generate your own headers (DTW_PRINT_HEADER="NO"), you must set DTW_REMOVE_WS="NO".
OS/390 users: Set this variable in the Net.Data initialization file to specify a value for all of your macros. You can override the value by defining it in the macro file. If DTW_REMOVE_WS is not defined in the macro file, it uses the value in the initialization file.
Values
DTW_REMOVE_WS="YES"|"NO"
Table 24. DTW_REMOVE_WS Values
| Values | Description |
|---|---|
| YES | Net.Data compresses a sequence of two or more white spaces to one new-line character, generating shorter HTML result pages. |
| NO | Net.Data does not compress white spaces. NO is the default. |
Examples
Example 1: Compressing white space
DTW_REMOVE_WS="YES"
| AIX | HP-UX | OS/2 | OS/390 | OS/400 | SCO | SUN | Win NT |
| X | X | X | X | X | X | X | X |
Purpose
The return code returned by a call to a built-in function or a call to a language environment. Net.Data uses this value to process MESSAGE blocks. You can use this variable to determine whether a function call succeeded or failed. A value of zero indicates successful completion of a function call.
You can reference the RETURN_CODE variable in any part of the Net.Data macro file.
This value is predefined; it is not recommended to modify the value. Use it as a variable reference.
Examples
Example 1: A message stating whether the function completed successfully
@function1()
%IF ("$(RETURN_CODE)" == "0")
The function completed successfully.
%ELSE
The function failed with the return code $(RETURN_CODE).
%ENDIF
Example 2: A default message when a return code is not 0
%MESSAGE{
default: "<h2>Net.Data received return code: $(RETURN_CODE)</h2>" : continue
%}
If a function returns a return code other than 0, the default message is displayed.