Example 2: Control statements to repair a VSAM KSDS data set

The following figure shows example control statements to repair a VSAM KSDS data set.

Figure 1. Example of repairing a VSAM KSDS data set
//ZAP      JOB     (installation accounting information) 
//KSDSTEP  EXEC    PGM=FABZVZAP                          
//STEPLIB  DD      DSNAME=DBT.SFABLMD0,DISP=SHR          
//SYSLIB   DD      DSNAME=DBT.KSDS,DISP=OLD              
//SYSPRINT DD      SYSOUT=A                              
//SYSIN    DD      *                                     
    PSW KSDSPASS                                         
    KEY MYABC                                            
      VER 00 0000                                        
      VER 2D C1C2C3                                      
      REP 00 47F0                                        
      REP 2D D1D2D3                                      
    KEY X'F1F3F540'                                      
      VER 1C 47F0                                        
      REP 1C 4780                                        
    KEY C'FIRSTRECORD,FIRSTRECORD,FIRSTRECORD',          
    X'0102030405060708090A0B0C0D0F1F2F',                 
    C'RECORDCONTINUERECORD CONTINUERECORD'               
      VER 2C 47F0                                        
      REP 2C 4780         
    RBA 140               
      VER 10 4780         
      REP 10 4700         
    RBA X'F2F0F0'         
      VER 8A 5810555C     
      REP 8A 5830555C     
    CNV 14350             
      VER 30 F1F2F5F6     
      REP 30 F9F9F9F9     
    CNV X'F1F3F8F8'       
      VER 26 4770         
      REP 26 47F0         
/*                        
//                        
  • If you use a password statement (PSW control statement), the statement must be first in the series of control statements.
  • KSDS records can be addressed by KEY, RBA, and CNV control statements.
  • RBA and CNV numbers can be expressed in either decimal or hexadecimal.
  • KEY can be expressed in any of character string, character literal, and hexadecimal formats when it is coded in a single line. When a long KEY is specified using several lines, it can be expressed in character literal or hexadecimal format or a combination of both.