MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Recover a deleted sequential file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> JCL/SORT
View previous topic :: View next topic  
Author Message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Nov 29, 2005 12:28 pm    Post subject: Recover a deleted sequential file Reply with quote

How to Recover a PS if it gets deleted / updated accidentally ?

A dataset which gets updated / deleted accidentally can be restored using HRECOVER command.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT1U304/2.10?SHELF=DGT1BK23&DT=19970429192119

Code:

Function - Recover a data set from a backup version                 
            or restore a data set from a dump copy                   
                                                                     
  Note:  Your data set may be restored from a dump copy rather       
  than recovered from a backup version.  This will happen if         
  the data set was on a volume that was dumped by DFSMShsm more     
  recently than it was backed up by DFSMShsm, and if the class(es)   
  to which the volume was dumped allow the restore of a data set     
  from a dump copy, and if you do not specify GENERATION or         
  VERSION.                                                           
                                                                     
  Specifying GENERATION or VERSION will cause the recover to         
  be done from a backup version, not a dump copy.  Specifying       
  GENERATION(0) will insure that the recovery is done from the       
  most recent available backup version.                             
                                                                     
  Note:  You cannot recover the backup versions of a cataloged data 
  set that is currently migrated, as specified in the computing     
  system catalog or the MCDS, until DFSMShsm recalls or deletes     
  the migrated data set.                                             
                                                                     
Syntax - 
  HRECOVER (dsname/password...)                                   
           EXTENDRC                                               
           FROMVOLUME(volid)                                     
           GENERATION(gennum) or DATE(date) or VERSION(vernum)   
           NEWNAME(newdsname/password)                           
           REPLACE                                               
           TOVOLUME(volid) UNIT(unittype)                         
           WAIT or NOWAIT                                         
                                                                 
  ALIAS - HRECOV                                                 
  REQUIRED - dsname, FROMVOLUME if data set was uncataloged at   
                      the time of backup.                         
  DEFAULTS - NOWAIT                                               
  Example 1                                                       
    HRECOVER CL.TEXT/WRITE FROMVOLUME(VOL003) +                       
            DATE(1984/01/05) NEWNAME(VER1TEXT.TEXT) +                 
            TOVOLUME(VOL001) UNIT(3330-1) WAIT                         
  Example 2                                                           
    HRECOVER PARTSTST.CNTL TOVOLUME(VOL007) UNIT(3350) REPLACE         
  Example 3                                                           
    HRECOVER OUTTESTS.TESTLIST GENERATION(2) WAIT EXTENDRC             
                                                                       
Operands -                                                             
DSNAME (dsname/password...) is a required positional parameter         
  you use to specify the name of the data set or list of names         
  of data sets to be recovered.  If the data set is protected         
  by a password, you must supply the password.  Password               
  protection does not apply to SMS-managed data sets.  For 'dsname',   
  substitute the name of the data set or list of names of the         
  data sets that you want to recover.  You can use a data-set         
  filter, or a fully qualified alias, for any dsname in a list.       
  If you specify a list of data sets or one or more filters,           
  each data set is associated with the other parameters               
  specified with the command.                                         
  Parentheses are not necessary if a single data set is specified.     
  For information on passwords and RACF security requirements,         
  type HELP HRECOVER OPER(SECURITY).                                   
                                                                       
                                                               
EXTENDRC - specifies that DFSMShsm will return a return code   
  and reason code to your CLIST or batch TSO job               
  (job that executes the program IKJEFT01).                     
  The &LASTCC control variable (in the case of a CLIST)         
  or register 15 (in the case of a batch TSO job)               
  will contain the return code in the high-order two bytes     
  and the reason code in the low-order two bytes.               
  Notes:                                                       
  This option is only appropriate when the command is issued   
  in a CLIST or TSO batch job, and when the WAIT option is     
  also specified.                                               
                                                               
FROMVOLUME(volid) is an optional parameter you use to           
  specify that a data set was uncataloged and that it resided   
  on the volume specified by 'volid' when DFSMShsm created the   
  backup version.  You must use the FROMVOLUME parameter to     
  recover a backup version of a data set if the data set was     
  uncataloged at the time DFSMShsm backed it up.  You cannot use
  the FROMVOLUME parameter for cataloged data sets.  When you   
  specify the FROMVOLUME parameter, DFSMShsm does not catalog the
  recovered backup version.                                     
                                                                 
GENERATION(gennum) specifies that you want to recover a         
  particular backup version of a specific data set.  For         
  'gennum', substitute the relative generation number of the     
  backup version of the data set that you want to recover.       
  Zero is the most recent backup version, 1 is the next to       
  the latest version, and so forth, up to the maximum           
  number of versions existing for the data set.  If you do not   
  specify GENERATION, DATE or VERSION, DFSMShsm recovers the     
  most recent backup version of the data set.                   
                                                                 
  Specifying GENERATION will cause the recover to be done from   
  a backup version, not a dump copy.  Specifying GENERATION(0)   
  will insure that the recovery is done from the most recent     
  available backup version.                                     
                                                                 
DATE  specifies that you want to recover the latest backup       
  version created on or before a particular date.  For 'date',   
  substitute the date in the following format for the backup     
  version of the data set that you want to recover.             
                                                                 
   o yy/mm/dd or mm/dd/yy, if you issue the command before       
     1 January 2000.                                             
   o yyyy/mm/dd, if you issue the command after 31 December 1999
   The backup version to be recovered is the newest one created on   
   or before the date specified.  You do not have to specify a       
   leading zero for a 1-digit month or day.  If you do not           
   specify GENERATION, DATE or VERSION, DFSMShsm recovers the       
   latest created backup version of the data set.  If you issue     
   the command before 1 January 2000 and specify the date in the     
   form mm/dd/yy, and do not specify the year (yy), the year         
   defaults to the current year.                                     
                                                                     
 VERSION(vernum) specifies that you want to recover a               
   particular backup version of a specific data set.  For           
   'vernum', substitute the particular version number of the         
   backup version of the data set that you want to recover.         
   If you do not specify GENERATION, DATE or VERSION,               
   DFSMShsm recovers the most recent backup version of the           
   data set.                                                         
                                                                     
   Specifying VERSION will cause the recover to be done from         
   a backup version, not a dump copy.                               
                                                                     
 NEWNAME(newdsname/password)  is an optional parameter you           
   use to specify a new data set name for the recovered backup       
   version of the data set.  For 'newdsname', substitute the         
   name to be given to the recovered data set.  If a data set       
   already exists with the same name as the new name you are         
   specifying, you must specify the REPLACE parameter to replace     
   the existing data set.  For 'password', substitute the           
   correct password and include the preceding slash (/).             
   Password protection does not apply to SMS-managed data sets.     
   For information on passwords and RACF security requirements       
   for the NEWNAME data set, type HELP HRECOVER OPER(NEWSECURITY).   

 REPLACE is an optional parameter you use to specify that           
   the recovered backup version of a data set is to replace         
   any existing data set with the same data set name on the         
   receiving volume or on any volume if the data set is             
   cataloged.  If you specify NEWNAME and the new name is the       
   same as the name of an existing data set, you must specify       
   the REPLACE parameter or DFSMShsm does not process the HRECOVER 
   command for that data set.  The data set being replaced is       
   uncataloged (if it was cataloged) and scratched.  The data       
   set to be replaced must have the same data set organization     
   as the data set from which the backup version was made (both     
   must be VSAM or both must be non-VSAM).                         
                                                                   
 TOVOLUME(volid) is an optional parameter you use to specify       
   the volume that is to receive a recovered data set.  For         
   'volid', substitute the serial number of the volume that you     
   want to receive the recovered data set.  If you do not           
   specify TOVOLUME, DFSMShsm recovers the backup version to the   
   volume where the catalog entry specifies the data set           
   currently exists or, if no catalog entry exists, to the         
   volume where it resided at the time DFSMShsm backed it up.  If   
   you specify TOVOLUME, you must also specify UNIT(unittype).     
   Notes:                                                           
   The TOVOLUME parameter is ignored when the data set is SMS       
   managed.                                                         
                                                                   
   If you are recovering a VSAM data set cataloged in a non-ICF     
   catalog, you can only specify with the TOVOLUME parameter a     
   volume owned by the catalog where the VSAM data set being       
   recovered is cataloged or will be cataloged.  The volume you     
   specify for TOVOLUME cannot be a migration volume.               
                                                             
 UNIT(unittype) is an optional parameter you use to specify         
   the type of unit where the receiving volume can be allocated.     
   For 'unittype', substitute the type of unit where the volume     
   that is to receive the recovered data set can be allocated.       
   The valid types of units are: 3330, 3330-1, 3330V, 3350,         
   3375, 3380, 3390, and 9345. If you specify UNIT, you must         
   also specify VOLUME. The UNIT parameter is ignored when the       
   data set is SMS managed.                                         
                                                                     
 WAIT specifies that you want to wait for the HRECOVER               
   command to complete.  The default is NOWAIT.                     
                                                                     
 NOWAIT specifies that you do not want to wait for the               
   HRECOVER command to complete.  The default is NOWAIT.             
                                                                     
 SECURITY - If you want to recover a RACF-protected data set         
   and you issue the HRECOVER command without the NEWNAME           
   parameter, you must have RACF ALTER authority to the data         
   set.  If you want to recover a RACF-protected data set and       
   you issue the HRECOVER command with the NEWNAME parameter,       
   you must have RACF READ authority for the data set.  In           
   addition, if the new name data set exists and is                 
   RACF-protected, you must have RACF ALTER authority for the       
   new name data set.                                               
                                                                     
   For a password-protected non-VSAM data set, supply the           
   password that allows you to write to the data set.  For a         
   password-protected VSAM data set: If the data set exists, you     
   must supply the current master password of the base               
   cluster.  If the data set does not exist, you must supply the     
   master password of the base cluster that existed when DFSMShsm   
   backed up the data set.                                           
                                                                     
 NEWSECURITY - If a password-protected non-VSAM data set         
   currently exists with the name specified by NEWNAME, you must 
   supply the password that allows you to write to the data set. 
   If a password-protected VSAM data set currently exists with   
   the name specified by NEWNAME, you must supply the master     
   password of the base cluster.                                 
                                                                 
   If the NEWNAME data set exists and is RACF-protected, you     
   must have RACF ALTER authority to the new name data set.       
                                                                 
   If you are recovering a RACF-protected data set, the RACF     
   profile for the old data set must exist because RACF security 
   checking is performed for the old and new data set names.     



Problems you may face with HRECOVER
http://www.mvsforums.com/helpboards/viewtopic.php?t=5194&highlight=dataset+recover

Related Topics
http://www.mvsforums.com/helpboards/viewtopic.php?t=5187&highlight=dataset+recover
http://www.mvsforums.com/helpboards/viewtopic.php?t=4642&highlight=dataset+recover
http://www.mvsforums.com/helpboards/viewtopic.php?t=62&highlight=dataset+recover

Thanks,
Phantom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> JCL/SORT All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group