11.01.2013 Views

ABCs of z/OS System Programming Volume 3 - IBM Redbooks

ABCs of z/OS System Programming Volume 3 - IBM Redbooks

ABCs of z/OS System Programming Volume 3 - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Logical records and blocks<br />

To an application, a logical record is a unit <strong>of</strong> information (for example, a customer, an<br />

account, a payroll employee, and so on). It is the smallest amount <strong>of</strong> data to be processed,<br />

and it is comprised <strong>of</strong> fields that contain information recognized by the processing application.<br />

Logical records, when located in DASD or tape, are grouped into physical records named<br />

blocks (to save space in DASD because <strong>of</strong> the gaps). Each block <strong>of</strong> data on a DASD volume<br />

has a distinct location and a unique address (block number, track, and cylinder), thus making<br />

it possible to find any block without extensive sequential searching. Logical records can be<br />

stored and retrieved either directly or sequentially.<br />

DASD volumes are used for storing data and executable programs (including the operating<br />

system itself), and for temporary working storage. One DASD volume can be used for many<br />

separate data sets, and space on it can be reallocated and reused. The maximum length <strong>of</strong> a<br />

logical record (LRECL) is limited by the physical size <strong>of</strong> the media used.<br />

Record format (RECFM)<br />

RECFM specifies the characteristics <strong>of</strong> the logical records in the data set. They can have a:<br />

► Fixed length (RECFM=F) - Every record is the same size.<br />

► Variable length (RECFM=V) - The logical records can be <strong>of</strong> varying sizes; every record<br />

has a preceding record descriptor word (RDW) to describe the length <strong>of</strong> such record.<br />

► ASCII variable length (RECFM=D) - Used for ISO/ANSI tape data sets.<br />

► Undefined length (RECFM=U) - Permits processing <strong>of</strong> records that do not conform to the<br />

F or V format.<br />

F, V, or D-format logical records can be blocked (RECFM=FB, VB or DB), which means<br />

several logical records are in the same block.<br />

Spanned records are specified as VS, VBS, DS, or DBS. A spanned record is a logical record<br />

that spans two or more blocks. Spanned records can be necessary if the logical record size is<br />

larger than the maximum allowed block size.<br />

You can also specify the records as fixed-length standard by using FS or FBS, meaning that<br />

there is not an internal short block.<br />

Logical record length (LRECL)<br />

LRECL specifies the length, in bytes, <strong>of</strong> each record in the data set. If the records are <strong>of</strong><br />

variable length or undefined length, LRECL specifies the maximum record length. For input,<br />

the field has no effect for undefined-length (format-U) records.<br />

Block size (BLKSIZE)<br />

BLKSIZE specifies the maximum length, in bytes, <strong>of</strong> the physical record (block). If the logical<br />

records are format-F, the block size must be an integral multiple <strong>of</strong> the record length. If the<br />

records are format-V, you must specify the maximum block size. If format-V records are<br />

unblocked, the block size must be 4 bytes (to specify the block length) greater than the record<br />

length (LRECL). For data sets in DASD the maximum block size is 32760. For data sets in<br />

tapes the maximum block size is much larger.<br />

In an extended-format data set, the system adds a 32-byte suffix to each block, which is<br />

transparent to the application program.<br />

40 <strong>ABCs</strong> <strong>of</strong> z/<strong>OS</strong> <strong>System</strong> <strong>Programming</strong> <strong>Volume</strong> 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!