AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | PTX | SUN | Win NT |
X | X | X | X | X | X | X | X | X |
Purpose
Opens a text file.
Format
@DTWF_OPEN(filename, mode, retry)
@DTWF_OPEN(filename, mode)
Parameters
Table 176. DTWF_OPEN Parameters
Data Type | Parameter | Use | Description |
---|---|---|---|
string | filename | INOUT | The name of the file to open. On successful completion of the call, this parameter returns the fully qualified file name. |
string | mode | IN | The type of access requested:
|
integer | retry | IN | The number of times to retry if the file cannot be opened immediately. The default is not to retry. |
Return Codes
Table 177. DTWF_OPEN Return Codes
Return Code | Explanation |
---|---|
-1001 | The server could not process a Net.Data request to allocate memory. |
1001 | An input parameter contained a NULL value. |
1002 | An input parameter contained a string value which consisted of the null-terminating character. |
1003 | An incorrect number of parameters were passed on a function call. |
1005 | A parameter passed on a function call, required to be a string variable, was of a different variable type. |
1006 | A literal string was passed on a function call for a parameter which was required to be an output parameter. |
1007 | A parameter contains a value which is not valid. |
2000 | A flat file interface built-in function could not find the specified file. |
2001 | A flat file interface built-in function could not open the specified file because it was in use by this or another process, and could not be shared in the specified mode. |
Usage Notes
Examples
Example 1:
%DEFINE { myFile = "c:/private/myfile" myMode = "r+" %} @DTWF_OPEN(myFile, myMode, "1000")