I have a dataset in tape. I want to copy this dataset to DASD into different DSN. I want the target dataset to have the exact DCB and space parameters of the source dataset which is in tape. Please let me know how to do that?
Also, Once a dataset has been moved to tape, how to identify whether it is PDS or PS? If a PDS or PS dataset has been moved tape, i believe it would always be copied as PS in tape. Then how would we determine whether it is a PS or PDS when we want to copy this back to DASD?
Joined: 06 Jun 2008 Posts: 8232 Location: Dubuque, Iowa, USA
In order to copy from tape to disk, you must know how the tape was created. If the tape was created using DF/DSS (ADRDSSU), then you must use ADRDSSU to restore the data set from tape to disk. A PDS copied to tape will be in IEBCOPY unload format (which is a sequential file, usually in variable blocked spanned format). If the tape file is fixed block, then IEBGENER or SORT was used to create a copy of a disk data set. However, there's a lot of ways to build a tape and you cannot always tell from inspection how the tape was built and how to restore the tape to disk.
If your site uses a tape management tool such as CA-1, query the volume in the tape management system and you should be able to find out what program was used to create the tape. A tape map program such as on the CBT tape can help identify the tape data format. Otherwise, you may have to dump the first block or two of data from the tape to see if there's enough helpful information to figure it out.
this is one way which you can do it :
//UNLOADCA JOB CLASS=A
//STEP1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=A
//SOURCE DD DSN=TEST.TEST222,DISP=(OLD,KEEP),
//DESTIN DD DSN=TEST.TEST444..&TI,DISP=(NEW,KEEP),
//SYSIN DD *