EXISTS

Tests to see if files exist during Enrichment processing.

Note: If you want to see if a file exists before dynamically assigning it to an insert page or insert record, set the file name to a variable and perform the EXISTS function on it. Then, use the EXISTS %%RC to set the insert page or insert record to the variable.

Syntax

EXISTS(filename)

Arguments

Argument Description Default
filename A string or the name of the file to check for. filename may be up to 255 characters in length. None

Results

Result Description
Return TRUE (1) if the file exists, otherwise FALSE (0).
Note: Since EXISTS returns a Boolean operator (TRUE or FALSE), you can use it within an IF instruction. For example, IF EXISTS(%%var) THEN....
%%RC One of the following:
1 File does not exist or is not found
0 File does not exist or is not found
-1 Invalid file name
%%RM An error message if there was a problem opening the file or a null string ('').
%%RV C C Error Number or 0

Examples

Function Call Return %%RC
EXISTS(DD:input1)

(DD:input1 is empty or does not exist)

0 1