IDIDSNTEST command

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

Figure 1. Syntax

1 IDIDSNTEST 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 IDIDSNTEST 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 IDITRACE DDname.

Example

Figure 2. IDIDSNTEST command example
/* REXX */

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