Post by AndreasPost by Peter VelsPost by AndreasPost by Peter VelsAndreas,
Are you doing this?
DEFINE CLUSTER -
(NAME(your.vsam.dataset) -
RECATALOG) -
DATA (NAME(your.vsam.dataset.DATA) VOLUMES(volser) ) -
INDEX (NAME(your.vsam.dataset.INDEX) VOLUMES(volser) )
Or something different? Please post your job output, so we can
see what
Post by AndreasPost by Peter Velsyou're doing.
Grüße
Peter
[Non-text portions of this message have been removed]
Hi Peter,
my job is the same as you type at top.
The message that i receive is IDC3009I with return code 86 and reason
code 6.
Explanation: Either the primary VSAM volume record (VVR) points to
another catalog, or the primary VVR or non-VSAM volume record (NVR)
for the object being recataloged was not found on the first volume
serial number specified. The primary VVR or NVR contains the data set
information needed to recatalog the object. Possible causes of this
error are: v No VVR exists. v A VVR exists, but it points to another
catalog. v Parameters were not specified as they were when the cluster
was originally defined. The parameters are NAME, INDEXED, LINEAR,
NONINDEXED, NUMBERED, and VOLUMES. Programmer Response: If no VVR
exists, then re-issue the DEFINE command, without the RECATALOG
parameter, for the ICF catalog. If the VVR exists but points to a
different catalog, specify the correct catalog and re-issue the DEFINE
command with the RECATALOG parameter. If the original values for
parameters NAME, INDEXED, LINEAR, NONINDEXED, NUMBERED, and VOLUMES
were not specified, specify the original values and re-issue the
DEFINE command with the RECATALOG parameter.
The Problem is that the VVDS don't include the catalog name that i use
for recatalog.
The old catalog (that is in the VVDS Record) are not accessable.
I can create the 'old' catalog, but that is not the solution that i
want.
Hi Andreas,
There is no chance. You have to recreate the old
catalog in order to recatalog your VSAM data set.
But with some effort, it is possible to make the
VSAM data set accessable as you want. In the past,
I was faced with several of such situations.
- recreate the old catalog
- recatalogue the VSAM data set
- backup the VSAM data set
- delete the VSAM data set
- delete the old catalog
- restore the VSAM data set
This sounds not so complicated, but there are some
pitfalls. So, in order to tackle the problem piece
1. Do other data sets currently exist on the volume,
where the VSAM data set resides.
2. What is the high level qualifier of your VSAM data
set?
3. Is it a qualifier, for which currently other data
sets exist?
4. If such data sets exist, are these data sets
cataloged in the master catalog or in a user
catalog pointed by an alias?
5. If such data sets exist in a user catalog, what
is the name of the alias?
6. Do you know the name of the old catalog?
7. Was the old catalog a master catalog or an user
catalog?
Depending on the answers, there are different
scenarios to solve the problem. I hope I hear
from you.
Best regard, Wolfhard
hello wolfhard,
thanks for your reply.
1. Yes
2. the hili is CRV
3. Yes (i catalog non-VSAM with this qualifier in the new catalog)
4. all exist datasets are currently catalog in a new user catalog.
5. the alias name is CRV
6. the old catalog was a user catalog.
best regards
Andreas
Hello Andreas,
I have prepared a document to explain all the steps, which you have to
carry out to solve your problem, but after completing the document, I
found that it is to large to be posted. Also, it is only easy to read
if a monospace font is used for the representation, which is not always
the case.
Therefore, for the sake of the community, I condensed the description
just to contain the JCL and the absolutely necessary explanations. If
you are interested in the complete document (I hope so), do not hesitate
to contact me via e-mail. You will find the address in my profile.
How to recover an uncataloged VSAM data set
-------------------------------------------
The following description is divided into four chapters:
A. Precautions
B. Determine the old catalog
C. The recovery
D. Cleanup
In the JCL examples below, various variables have to be substituted:
- <alias> by the name of the alias (usually the high level
qualifier of the VSAM data set)
- <current_catalog> by the name of the user catalog currently
pointed by the alias <alias>
- <export_dataset> by the name of the export (save) data set
to be used during recovery
- <no_of_disks> by the number of available backup volumes for
new auxiliary data sets
- <old_catalog> by the name of the user catalog, where the
VSAM data set was cataloged before
- <primary> by the number of cylinders for the primary
allocation of a new auxiliary data set
- <secondary> by the number of cylinders for the secondary
allocation of a new auxiliary data set
- <sms_parameter> by an IDCAMS keyword with an appropiate
value, which allows direction of an allocation of an object
to a certain volume (e.g. VOLUMES(...), STORAGECLASS(...),
etc.)
- <volser> by the volume serial of the disk with the
uncataloged VSAM data set
- <volume_backup_dataset> by the name of the volume backup
data set to be used
- <vsam_dataset> by the name of the uncataloged VSAM data set,
which has to be recovered
A. Precautions
Backup the volume, where the VSAM data set reside:
//*************************************************************
//* JOB TO BACKUP VOLUME <volser>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (<volume_backup_dataset>) NONVSAM SCRATCH PURGE
IF LASTCC EQ 8 THEN SET MAXCC = 0
/*
//*
//STEP020 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//INDD DD DISP=OLD,
// UNIT=SYSALLDA,
// VOL=SER=<volser>
//OUTDD DD DISP=(NEW,CATLG,DELETE),
// DSN=<volume_backup_dataset>,
// UNIT=(SYSALLDA,<no_of_disks>),
// SPACE=(CYL,(<primary>,<secondary>),RLSE)
//SYSIN DD *
DUMP FULL INDDNAME(INDD) OUTDDNAME(OUTDD) OPTIMIZE(4) ADMINISTRATOR
/*
The eventually needed restore JCL:
//*************************************************************
//* JOB TO RESTORE VOLUME <volser>
//*************************************************************
//STEP010 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//INDD DD DISP=OLD,
// DSN=<volume_backup_dataset>
//OUTDD DD DISP=OLD,
// UNIT=SYSALLDA,
// VOL=SER=<volser>
//SYSIN DD *
RESTORE FULL INDDNAME(INDD) OUTDDNAME(OUTDD) ADMINISTRATOR
/*
Note:
The restore will abend, if the volume is in use by any job. A case,
which is easily overlooked, is an active user catalog on the volume.
Such a catalog has to be disconnected via IDCAMS EXPORT DISCONNECT.
But be carefull, all aliases pointing to this catalog will be
deleted. So, at least, a listing of the associations of the catalog
entry from the master catalog should be available. After the restore,
if user catalogs have been disconnected, they have to be connected
via IDCAMS IMPORT CONNECT and the aliases for each catalog have to be
redefined.
B. Determine the old catalog
Use IDCAMS DIAGNOSE to interogate the catalog, where the not
cataloged VSAM data set has been cataloged before:
//*************************************************************
//* JOB TO DIAGNOSE VVDS ON <volser>
//*************************************************************
// SET VOLSER='<volser>'
//STEP010 EXEC PGM=IDCAMS
//VVDSDD DD DISP=SHR,
// DSN=SYS1.VVDS.V&VOLSER,
// UNIT=SYSALLDA,
// VOL=SER=&VOLSER
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DIAGNOSE VVDS INFILE(VVDSDD) COMPAREDS(<current_catalog>)
/*
Usually, the diagnose will show two Z records, which are the VVRs
for the data and the index component of the VSAM cluster. In both
records, the original catalog name is the third readable data set
name.
Note:
If the reason code in message IDC21364I (and IDC21363I) is not 42,
it may indicate a more damaged VVDS or BCS and the method described
here is not applicable.
C. The recovery
There are 8 steps to perform the recovery:
1. Define the old catalog
2. Delete and redefine the alias to point to the old catalog
3. Recatalog the VSAM data set into the old catalog
4. Save (export) the VSAM data set
5. Delete the saved VSAM data set
6. Delete and redefine the alias to point back to the desired catalog
7. Restore (import) the VSAM data set
8. Optionally refine the VSAM data set
1. Define the old catalog
To define the old catalog, execute the JCL:
//*************************************************************
//* JOB TO DEFINE USER CATALOG <old_catalog>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE -
USERCATALOG( -
NAME(<old_catalog>) -
ICFCATALOG -
<sms_parameter> -
CYLINDERS(2 1) -
FREESPACE(10 10) -
SHAREOPTIONS(3 4) -
STRNO(3) ) -
DATA( -
CONTROLINTERVALSIZE(4096) -
BUFND(8) ) -
INDEX( -
BUFNI(8) )
/*
//*
//STEP020 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES(<old_catalog>) ALL
LISTCAT ALL CATALOG(<old_catalog>)
/*
2. Delete and redefine the alias to point to the old catalog
JCL to delete the alias:
//*************************************************************
//* JOB TO DELETE ALIAS <alias>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (<alias>) ALIAS
/*
JCL to define the alias to point to the previously defined catalog:
//*************************************************************
//* JOB TO DEFINE ALIAS <alias> -> USER CATALOG <old_catalog>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE ALIAS (NAME(<alias>) RELATE(<old_catalog>))
/*
//*
//STEP020 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES(<alias>) ALL
/*
3. Recatalog the VSAM data set into the old catalog
Recatalog JCL:
//*************************************************************
//* JOB TO RECATALOG <vsam_dataset>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER (NAME(<vsam_dataset>) -
VOLUMES(<volser>) -
RECATALOG)
/*
Note:
As the IBM literature states, do not forget to code any of the
following keywords in conjunction with RECATALOG, if the original
VSAM data set has not used the default values:
ATTEMPTS, AUTHORIZATION, CATALOG, CODE, FOR, MODEL, OWNER, TO
4. Save (export) the VSAM data set
JCL to save the VSAM data set via IDCAMS EXPORT TEMPORARY:
//*************************************************************
//* JOB TO EXPORT (SAVE) <vsam_dataset>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (<export_dataset>) NONVSAM SCRATCH PURGE
IF LASTCC EQ 8 THEN SET MAXCC = 0
/*
//*
//STEP020 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SAVE DD DISP=(NEW,CATLG,DELETE),
// DSN=<export_dataset>,
// UNIT=(SYSALLDA,<no_of_disks>),
// SPACE=(CYL,(<primary>,<secondary>),RLSE)
//SYSIN DD *
EXPORT <vsam_dataset> -
OUTFILE(SAVE) -
TEMPORARY
/*
5. Delete the saved VSAM data set
JCL to delete the recataloged VSAM data set:
//*************************************************************
//* JOB TO DELETE <vsam_dataset> AFTER SAVE
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (<vsam_dataset>) CLUSTER SCRATCH PURGE
/*
6. Delete and redefine the alias to point back to the desired catalog
JCL to delete the alias:
//*************************************************************
//* JOB TO DELETE ALIAS <alias>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (<alias>) ALIAS
/*
JCL to define the alias to point to the desired catalog:
//*************************************************************
//* JOB TO DEFINE ALIAS <alias> -> USER CAT <current_catalog>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE ALIAS (NAME(<alias>) RELATE(<current_catalog>))
/*
//*
//STEP020 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES(<alias>) ALL
/*
7. Restore (import) the VSAM data set
Restore JCL:
//*************************************************************
//* JOB TO IMPORT (RESTORE) <vsam_dataset>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SAVE DD DISP=SHR,
// DSN=<export_dataset>
//SYSIN DD *
IMPORT INFILE(SAVE) OUTDATASET(<vsam_dataset>)
/*
8. Optionally refine the VSAM data set
Following steps have to be performed:
a) Delete the VSAM cluster again with IDCAMS DELETE CLUSTER
b) Define it with IDCAMS DEFINE CLUSTER with changed attributes
c) Import the VSAM data set with IDCAMS IMPORT INTOEMPTY
d) To prove the result, execute IDCAMS LISTCAT ENTRIES
Here are the JCL for these steps:
a) Delete the VSAM cluster again with IDCAMS DELETE CLUSTER
//*************************************************************
//* JOB TO DELETE <vsam_dataset>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (<vsam_dataset>) CLUSTER SCRATCH PURGE
/*
b) Define it with IDCAMS DEFINE CLUSTER with changed attributes
//*************************************************************
//* JOB TO DEFINE LARGER <vsam_dataset>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER -
(NAME(<vsam_dataset>) -
INDEXED -
CYLINDERS(60 10) -
STORAGECLASS(TESTHCC1) -
KEYS(10 0) -
RECORDSIZE(80 80) -
)
/*
//*
//STEP020 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES(<vsam_dataset>) ALL
/*
c) Import the VSAM data set with IDCAMS IMPORT INTOEMPTY
//*************************************************************
//* JOB TO IMPORT (RESTORE) <vsam_dataset> INTOEMPTY
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SAVE DD DISP=SHR,
// DSN=<export_dataset>
//SYSIN DD *
IMPORT INFILE(SAVE) OUTDATASET(<vsam_dataset>) INTOEMPTY
/*
d) To prove the result, execute IDCAMS LISTCAT ENTRIES
//*************************************************************
//* JOB TO LIST LEVEL <alias>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES(<vsam_dataset>) ALL
/*
Repeat the stepa a) through d) until satisfied.
D. Cleanup
3 Jobs habe to be executed to cleanup the system:
a) Delete old catalog
b) Delete volume backup data set
c) Delete export data set
The JCL for these steps are:
a) Delete old catalog
//*************************************************************
//* JOB TO DELETE USER CATALOG <old_catalog>
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (<old_catalog>) USERCATALOG PURGE
/*
b) Delete volume backup data set
//*************************************************************
//* JOB TO DELETE VOLUME BACKUP DATA SET
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (<volume_backup_dataset>) NONVSAM SCRATCH PURGE
/*
c) Delete export data set
//*************************************************************
//* JOB TO Delete the export data set
//*************************************************************
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (<export_dataset>) NONVSAM SCRATCH PURGE
/*
Best regards, Wolfhard