Functions and CALL Routines under z/OS |
Verifies the existence of an external file in the z/OS system
catalog by its physical name.
Category: |
External Files
|
z/OS specifics: |
all
|
- filename
-
specifies a physical filename of an external file. In a
DATA step, filename can be a character expression,
a character string in quotation marks, or a DATA step variable. In a macro, filename can be any expression.
Only native z/OS data set names can be specified;
filename cannot specify an HFS path.
DSNCATLGD returns a value of 1 if the filename is found
in the z/OS system catalog, and a value of 0 if the filename is not found
in the catalog.
DSNCATLGD is similar to the FILEEXIST function, but there are some differences
that make DSNCATLGD the preferred function to use in some circumstances. DSNCATLGD
does not cause dynamic allocation to occur, which is useful for tape data
sets because it does not require that a tape be mounted.
When a batch job is creating a new z/OS data set, DSNCATLGD will not
return a value of 1 until the job step that creates the data set terminates.
FILEEXIST, which uses dynamic allocation to verify that the data set exists,
returns a value of 1 anytime after the start of the batch job that is creating
the data set.
Note: z/OS enters a dynamically allocated data set into
the system catalog immediately at the time of the dynamic allocation request.
All allocations made by TSO users are treated in this
manner. ![[cautionend]](../../../../common/63294/HTML/default/images/cautend.gif)
FILEEXIST Function: z/OS
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.