Mainframes360 Search

Loading

Darn it!

What’s new at MAINFRAMES 360
(Updates)...
- Subscribe to Mainframes360.com MAILING LIST and receive my articles and posts right in your mailbox...
- Resolved some Display issues and filling in the gaps(missing tutorials like VSAM)
- Posting several Video tutorials

Friday, July 3, 2009

JCL Tutorial – 08 : DD Statement – Part III


Q. What is the UNIT Parameter?
A. Sometimes, the Input Dataset from which we want to read Data Records may be located on a TAPE Drive. Also, when IBM Mainframe Servers are installed(a process called as SYSGEN), different I/O Devices are assigned an Address. This device address uniquely identifies the device.

Apart from this, similar devices are grouped together and sometimes assigned a symbolic name.

UNIT parameter can be used to identify a device, by the device address, symbolic name or mentioning TAPE(for tape drive).  


//TRGD56 JOB A123,QUASAR,CLASS=A,PRTY=14,
//   MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP01 EXEC PGM=PROGRAM1
//INDD DD DSN=TRGD56.DEMO.INPUT,
//   DISP=SHR,
//   UNIT=SYSDA

This implies, that the input dataset TRGD56.DEMO.INPUT is located on the device group whose symbolic name is SYSDA.

The UNIT parameter has AFF(Affinity) sub-parameter. To use the same unit, that has been used by a prior DD Statement, AFF sub-parameter is used.

//TRGD56 JOB A123,QUASAR
//STEP01 EXEC PGM=PROGRAM1
//INDD DD DSN=TRGD56.DEMO.INPUT,DISP=SHR,UNIT=SYSDA
//OUTDD DD DSN=TRGD56.DEMO.OUTPUT,DISP=(NEW,CATLG),
//   UNIT=AFF=INDD

Q. What is the VOL(VOLUME) Parameter used for?
The VOL parameter is used to specify disk volume on which the Input and Output datasets reside. The VOL parameter has several sub-parameters.

SER Specifies the serial number of the device. Every device has a serial number by which it can be identified.
REF Used to refer back to a VOL in a previous job-step.
PRIVATE Allows access to this disk volume by only 1 user.
RETAIN Prevents the volume from being dismounted, till the Batch JOB ends. 
SEQ The SEQ sub-parameter allows you to tell the MVS O/S, in what order, or in what sequence the volumes should be mounted. This is applicable only if the dataset is very large and occupies multiple volumes.

Let’s see some examples.

//TRGD56 JOB A123,QUASAR
//STEP01 EXEC PGM=PROGRAM1
//INDD DD DSN=TRGD56.DEMO.INPUT,DISP=SHR,
//   VOL=VOL1

In the above example, the dataset resides on the volume VOL1. Now, lets see another example wherein, the dataset resides on 3 volumes.

//TRGD56 JOB A123,QUASAR
//STEP01 EXEC PGM=PROGRAM1
//INDD DD DSN=TRGD56.DEMO.INPUT,DISP=SHR,
//   VOL=(VOL1,VOL2,VOL3)

In the above example, the dataset TRGD56.DEMO.INPUT resides on all the 3 volumes VOL1, VOL2 and VOL3. This requests the MVS O/S to mount all the three volumes at the same time.

//TRGD56 JOB A123,QUASAR
//STEP01 EXEC PGM=PROGRAM1
//OUTDD DD DSN=TRGD56.DEMO.OUTPUT,
//   DISP=(NEW,CATLG,DELETE),
//   VOL=SER=T02947

Here, the Output dataset will be created on the tape drive, whose serial number is T02947.

//TRGD56 JOB A123,QUASAR
//STEP01 EXEC PGM=PROGRAM1
//OUTDD DD DSN=TRGD56.DEMO.OUTPUT,
//   DISP=(NEW,CATLG,DELETE)
//   VOL=(,RETAIN,SER=T02947)

Here, the Output dataset will be created on the device serial number T02947, and this volume will not be dismounted until the Batch JOB ends.
Q. What is the LABEL parameter used for?
Whenever tape datasets are used as Input Dataset or Output Dataset, LABEL parameter can be used.

//TRGD56 JOB A123,QUASAR
//STEP01 EXEC PGM=PROGRAM1
//OUTDD DD DSN=TRGD56.DEMO.OUTPUT,
//   DISP=(NEW,CATLG,DELETE),
//   LABEL=1

Q. What is the SPACE parameter used for?
When we create a new dataset, we would like to specify, how much storage space to reserve for the dataset. Storage Space Allocation can be specified using the SPACE parameter.

Firstly, we must specify the unit of memory. We can specify it as BLKS(Blocks), TRKS(Tracks), CYL(Cylinders), KB(Kilotbytes) or MB(MegaBytes).

Secondly, we must specify space we need - (primary,secondary). Upto 15 extends of the primary space will be available, and 1 extend of secondary space.
Thus, if we specify the space as

SPACE=(TRKS,(1,1))

Minimum
Space Allocated(In Best Case) = 1 + 1 = 2 tracks.
Maximum Space Allocated(In Worst Case) = 1 x 15 + 1 = 16 tracks.

The SPACE Parameter also has sub-parameters like RLSE, MXIG, CONTIG and ROUND.

RLSE RLSE sub-parameter instructs the MVS O/S to release the previously allocated space, but which remained unused.
CONTIG CONTIG sub-parameter instructs the MVS O/S to allocate contiguous space.
MXIG MXIG sub-parameter instructs the MVS O/S to allocate the largest possible chunk of contiguous storage space.
ROUND ROUND sub-parameter instructs the MVS O/S to allocate the entire cylinder for the storage of the dataset.
Q. What is the DCB(Data Control Block) Parameter used for?
The DCB parameter is used to specify the organization of records within the dataset. The DCB Parameter has 4 sub-parameters :

RECFM This is used to specify the Record Format. It can be Fixed F, Fixed Blocked FB, Variable V, Variable Blocked VB, Uniform U
LRECL It stands for Logical Record Length. It is used to specify the length of the record.
BLKSIZE This is used to specify the size of the Block. A block is the unit of I/O Transfer. BLKSIZE must be a multiple of LRECL.
DSORG Dataset Organisation. It is used tell the MVS O/S whether the given dataset, is a PS(Physical Sequential File), PO(Partitioned Organized) – A directory in which each file is PS, IS(Indexed Sequential) or DA(Direct Access).


Let’s understand the DCB parameter with the help of an example.

//TRGD56 JOB A123,QUASAR
//STEP01 EXEC PGM=IEFBR14
//INDD DD DSN=TRGD56.DEMO.INPUT,DISP=SHR
//OUTDD DD DSN=TRGD56.DEMO.OUTPUT,
//   DISP=(NEW,CATLG,DELETE),
//   DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DIRBLKS=1),
//   SPACE=(TRKS,(1,1),RLSE)

1 comments:

Anonymous said...

here ,This chaper should be II,not III.

Thanks.

Post a Comment

Note :

© Copyright – Quasar Chunawalla, Tata Consultancy Services,2009.
Note : The copyrights of all the material, text and pictures posted in this website belong to the author. Any instance of lifting the material from this website, shall be considered as an act of plagiarism. For any clarifications, please mail at quasar.chunawala@tcs.com

Quotation of the Day