AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | PTX | SUN | Win NT |
X | X | X | X | X | X | X | X | X |
Purpose
Deletes lines from a text file.
Format
@DTWF_DELETE(filename, transform, delimiter, retry, rows, startline)
@DTWF_DELETE(filename, transform, delimiter, retry, rows)
@DTWF_DELETE(filename, transform, delimiter, retry)
@DTWF_DELETE(filename, transform, delimiter)
Parameters
Table 172. DTW_DELETE Parameters
Data Type | Parameter | Use | Description |
---|---|---|---|
string | filename | INOUT | The name of the file whose records are to be deleted. On successful completion of the call, this parameter returns the fully qualified file name. |
string | transform | IN | The format of the file:
|
string | delimiter | IN | A character string to indicate the ends of values. This parameter is case sensitive. Ignored if transform is ASCIITEXT. |
integer | retry | IN | The number of times to retry if the records cannot be deleted immediately. The default is not to retry. |
integer | rows | IN | The maximum number of rows to delete. The default is to delete all the rows. Specifying 0 deletes all rows. |
integer | startline | INOUT | The line number from which to begin deleting. A value of 1 means to begin deleting at the first line. If this value is greater than the number of lines in the file, an error is returned and the value of this parameter is changed to the number of lines in the file. The default is 1. |
Return Codes
Table 173. DTWF_DELETE 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. |
2003 | A flat file interface built-in function could not read a row of data into a table variable because the number of bytes in the row exceeded the maximum supported number of bytes. |
2004 | A flat file interface built-in function was attempting to find a file, but encountered a path in the FFI_PATH configuration file variable that was longer than the maximum supported number of bytes, which is 4095. |
2005 | A call to a system function failed. |
2006 | A flat file interface built-in function could not access the specified file because it was in use by this or another process and could not be shared in the specified mode. |
Examples
Example 1:
%DEFINE { myFile = "c:/private/myfile" myTable = %TABLE myWait = "5000" myRows = "2" %} @DTWF_DELETE(myFile, "Delimited", "|", myWait, myRows)
Example 2:
%DEFINE { myFile = "c:/private/myfile" myTable = %TABLE myStart = "1" myRows = "2" %} @DTWF_DELETE(myFile, "Asciitext", "|", "0", myRows, myStart)