Note: Built-In Function Rules Usage Options
Submits a job to delete a file and its associated logical files and I/O module.
This is a Specialized Built-In Function for use in a Development Environment only.
Arguments for Visual LANSA
|
Arguments for LANSA for i
For further information, refer to Delete a file from the System described in Submitting the Job to Delete a File Definition in the LANSA for i User Guide.
|
Return Values
|
Example
A user wants to control the deletion of files and associated logical views and I/O module using their own version of the "Delete a file from the System" facility.
********* Define arguments and lists
DEFINE FIELD(#FILNAM) TYPE(*CHAR) LENGTH(10)
DEFINE FIELD(#LIBNAM) TYPE(*CHAR) LENGTH(10)
DEFINE FIELD(#RETCOD) TYPE(*CHAR) LENGTH(2)
BEGIN_LOOP
********* Request File and library name
REQUEST FIELDS(#FILNAM #LIBNAM)
********* Execute built-in-function - DLT_FILE
USE BUILTIN(DLT_FILE) WITH_ARGS(#FILNAM #LIBNAM)
TO_GET(#RETCOD)
********* Check if submission was successful
IF COND('#RETCOD *EQ ''OK''')
MESSAGE MSGTXT('Delete of file submitted successfully')
CHANGE FIELD(#FILNAM) TO(*BLANK)
ELSE
MESSAGE MSGTXT('Delete submit failed with errors,
refer to additional messages')
ENDIF
END_LOOP