HFZDSNTEST command

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

Read syntax diagramSkip visual syntax diagram
Syntax

>>-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 1. 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’