IDC3013I: Duplicate data set name
IDC3013I means IDCAMS tried to add a name to the catalog, through DEFINE or a rename with ALTER NEWNAME, and that name is already cataloged. It comes with IDC3009I catalog return code 8, reason code 38, and the command fails.
Other names for this code
Also written as IDC3013, IDC3013I DUPLICATE DATA SET NAME, IDC3009I 8-38, IDC3009I RETURN CODE 8 REASON CODE 38, IGG0CLEH-38, IDCAMS duplicate data set name.
What it means
Every name in a catalog has to be unique. When IDCAMS defines a cluster, an alternate index, a GDG base, a non-VSAM entry or an alias, or renames an entry, catalog management adds the new name. If the name is already there, catalog management refuses, and IDCAMS writes IDC3013I.
The next message, IDC3009I, carries return code 8 with reason code 38, the code for a name that already exists when adding an entry. The module shown is usually IGG0CLEH. The command fails, nothing is defined, and IDCAMS sets a nonzero condition code.
A VSAM cluster uses more than one name. The cluster has a name, and so do its data component and, for a KSDS, its index component. Any of them can clash with an existing entry.
The usual story is a rerun. The job deletes and redefines a cluster, the DELETE didn't happen or failed, and the DEFINE then meets the cluster left from the previous run. IBM APARs also show the message from software that renames data sets into a catalog that already holds the target name.
Common causes
- The job was rerun and the data set from the earlier run still exists, because the DELETE before the DEFINE failed or was skipped.
- The DELETE ran against the wrong catalog or with a misspelled name, so it removed nothing and the DEFINE failed.
- The data or index component name chosen for the new cluster is already used by another entry.
- An ALTER NEWNAME or a rename job used a target name that already exists in the catalog.
- Two jobs define the same name, for example a test job and a production job sharing a qualifier.
How to find the problem
- Read the name in the DEFINE or ALTER command just above IDC3013I in SYSPRINT.
- Check IDC3009I below it. Return code 8 with reason 38 confirms a duplicate name. Another code means a different problem.
- Run
LISTCAT ENTRIES('PROD.for the cluster name and for the data and index component names, to see what already holds the name.PAYROLL. MASTER') ALL - Check the messages for the DELETE step or command that ran before the DEFINE, to see why it didn't remove the old entry.
How to fix it
- Delete the existing entry first if it is the leftover from a failed run, then run the DEFINE again.
- Make the job safe to rerun. Put a DELETE before the DEFINE and follow it with
IF LASTCC = 8 THEN SET MAXCC = 0, so a missing data set doesn't stop the job but a real duplicate is cleared. - Pick a different name, or give the data and index components names of their own.
- For a rename, check the target name with LISTCAT before running the rename.
What it looks like
IDC3013I DUPLICATE DATA SET NAME IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLEH-38
IBM documentation
IBM documentation: IDC3013I. Use the documentation for your installed release.
Related codes
Questions
What does IDC3009I return code 8 reason code 38 mean?
The name being added to the catalog already exists. It is the reason code that goes with IDC3013I.
Why do I get IDC3013I when I deleted the data set first?
The DELETE probably didn't remove it. Check its messages for IDC3012I or another error, and check that it used the same name and catalog as the DEFINE.
Can the data component name cause IDC3013I?
Yes. The cluster, data and index names all go into the catalog, and each must be unique.