Copying files from Tapes to DASD

 

Copying files from Tapes to DASD
 
 
The following article presents two methods of retrieving 
file from tape to DASD
 
 
A file can be saved on different volumes of tapes using the same name. 
If we do not specify the volume then,it will get the file recently 
saved.
 
No volume specified:-
 
Using IDCAMS -
 
//STEP001  EXEC PGM=IDCAMS                          
//INPUT    DD DSN=FILE.ON.TAPE,                     
//            DISP=SHR                              
//OUTPUT   DD DSN=FILE.ON.DASD,                     
//            DISP=(NEW,CATLG,DELETE),              
//            UNIT=SYSDA,                          
//            DCB=(RECFM=FB,LRECL=200,BLKSIZE=0),   
//            SPACE=(CYL,(500,500),RLSE)          
//SYSIN    DD *                                     
REPRO INFILE(INPUT) OUTFILE(OUTPUT) -              
/* 
 
Using IEBGENER -
 
//COPY1    EXEC PGM=IEBGENER                                
//SYSUT1 DD DSN=FILE.ON.TAPE,                     
//         DISP=SHR                                         
//SYSUT2   DD DSN=FILE.ON.DASD,                     
//         DISP=(NEW,CATLG,DELETE)                          
//SYSPRINT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
 
 
 
Volume No specified
 
Using IDCAMS -
 
 
//STEP001  EXEC PGM=IDCAMS                                 
//INPUT    DD DSN=FILE.ON.TAPE,DISP=OLD,      
//            VOL=SER=VOL001
//OUTPUT   DD DSN=FILE.ON.DASD,         
//            DISP=(NEW,CATLG,DELETE),              
//            UNIT=SYSDA,                          
//            DCB=(RECFM=FB,LRECL=200,BLKSIZE=0),   
//            SPACE=(CYL,(500,500),RLSE)          
//SYSIN    DD *                                     
REPRO INFILE(INPUT) OUTFILE(OUTPUT) -              
/*                                                  
 
 
Using IEBGENER -
 
//COPY1    EXEC PGM=IEBGENER                              
//SYSUT1 DD DSN=FILE.ON.TAPE,
//         UNIT=TAPE,                                     
//         VOL=SER=VOL001,                                
//         DISP=OLD                                       
//SYSUT2   DD DSN=FILE.ON.DASD,         
//         DISP=(NEW,CATLG,DELETE),                       
//SYSPRINT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
 
 
Where VOL001 is the volume number of the dataset on tape.
 
 
Note:- If you are using IDCAMS then you must specify the LRECL and RECFM otherwise 
the JCL will fail with return code of 12, as it will not be able to open the new file.
 
and when no volume is specified remember to give the disposition of tape file as OLD instead
of SHR

Comments

Hi,

I am trying to copy a huge tape to DASD. I got an error for UNSUCCESSFUL SORT - D37. Could anyone help. I have already tried putting DATACLAS=HUGE !!
 

Thanks, Prateek

Try to put UNIT=(SYSDA,4) ... 4 means that the dataset will allocate on 4 volumes.

 

Yves Roy

Thanks Roy.

But still i got RC 12.

Thanku,M

How big is your dataset? 

Have you looked up the cause of the D37? If not you need to do so.

Suggest you use your sort product rather than IDCAMS. Specify COPY rather than SORT.

Try using the sort and if there is a problem, post the jcl and sort control statements as well as the diagnostic info generated by the run.

my tape dataset is of variable block format.

when i am using IDCAMS utility to copy it to a flat file, i am not able to do that.
pls tell me how to use IDCAMS when tape is of VB format.

regards,

gaurav

//GENERA   EXEC PGM=IEBGENER                           
//SYSUT1   DD  DSN=DATASET.ON.TAPE,
//             DISP=SHR                                
//SYSUT2   DD  DSN=DATASET.ON.SYSDA,    
//             DISP=(NEW,CATLG,DELETE),                
//             UNIT=SYSDA,                             
//             DCB=*.SYSUT1 

As suggested earlier, use your sort product to copy files. Many systems now invoke the sort when a simple copy is detected by IEBGENER.

Using the sort or IEBGENER should not require specification of the output dcb info. It will use the same dcb as the input dataset.