HFZDSNTEST command

The HFZDSNTEST command can be used to test if a data set exists.

Figure 1. Syntax

1 HFZDSNTEST DSN ( dsname )

Parameters

dsname
Specifies the fully qualified name of the data set to be tested for existence. Do not enclose the data set name in single quotes.

Return codes

The HFZDSNTEST command provides the following return codes:

0
The specified data set exists.
4
The specified data set does not exist.
8
Command syntax error. An explanation of the error is written to the HFZTRACE DDname.

Example

Figure 2. HFZDSNTEST command example
/* REXX */

/* Test if the data set MY.HIST is allocated */
"HFZDSNTEST DSN(MY.HIST)"
if RC = 0 then say ’MY.HIST exists’