How to manage tape data sets like DD,UNIT,DCB,Volume Parameter in JCL

Examples of simple DD statements for tape data sets
The allocation of an existing cataloged data set
//JOURNAL  DD   DSNAME=MMA2.AR.JOURNAL,DISP=OLD

The allocation of an existing uncataloged data set
//JOURNAL  DD   DSNAME=MMA2.AR.JOURNAL,DISP=OLD,
               UNIT=TAPE,VOL=SER=300123

The allocation of an existing, uncataloged multi-volume data set
//JOURNAL  DD   DSNAME=MMA2.AR.JOURNAL,DISP=OLD,
               UNIT=TAPE,
               VOL=SER=(300123,300124,300125,300126)

The allocation of a new data set on an unspecified tape volume
//JOURNAL  DD   DSNAME=MMA2.AR.JOURNAL,DISP=(NEW,CATLG,DELETE),
               UNIT=TAPE

Examples of UNIT parameters
A request for two tape drives
UNIT=(TAPE,2)

A request that defers the mounting of the tape until the data set is opened
UNIT=(TAPE,,DEFER)

A request for the same tape drive that was used for the data set described by the DD statement for TAPEDD1
UNIT=AFF=TAPEDD1

Examples of VOLUME parameters
A specific request for four named volumes
VOL=SER=(163013,163014,163015,163016)

A non-specific request for up to 20 volumes
VOL=(,,,20)

A request for the third volume of a multi-volume data set
VOL=(,,3)

A specific request for two private volumes
VOL=(PRIVATE,SER=(MMA301,MMA302))

A specific request for a private volume that shouldn’t be dismounted
VOL=(PRIVATE,RETAIN,SER=MMA400)

A RETPD parameter that sets a retention period of 30 days
//LNMAST   DD   DSNAME=MMA2.LN.MASTER,DISP=(NEW,KEEP),
               UNIT=TAPE,VOL=SER=300123,RETPD=30

An EXPDT parameter that sets the expiration date to the last day of 2002
//JOURNAL  DD   DSNAME=MMA2.AR.JOURNAL,DISP=(NEW,CATLG,DELETE)
               UNIT=TAPE,EXPDT=2002/365

Examples of LABEL parameters
Specifies IBM standard labels with user labels
LABEL=(,SUL)

Specifies processing of the fourth data set and ISO/ANSI/FIPS standard labels
LABEL=(4,AL)

Specifies that label processing be bypassed and that the second data set be processed (which is the first set of data records on a tape with standard labels)
LABEL=(2,BLP)

Specifies that the tape volume is unlabelled
LABEL=(,NL)

Examples of DCB parameters
The data set should be written in ASCII format
DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=4000,OPTCD=Q)

The data set should be written with 1600 bpi on a dual-density tape drive
DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=4000,DEN=3)

The data set should be written with data compaction on a cartridge tape drive
DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=4000,TRTCH=COMP)

0 comments:

Computers TopOfBlogs Technology Blogs Mainframe interview question and answers,mainframe jobs,cobol,vsam,jcl,cics,db2,rdbms,mvs,tso,ispf,ibm,hcl,tcs,cts,wibro Blog Directory