The NoteBook of EricKong

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  610 Posts :: 1 Stories :: 190 Comments :: 0 Trackbacks
Data set record formats
数据集记录根式
z/OS concepts
Z/OS的概念
Traditional z/OS® data sets are record oriented, and have one of five possible formats.
传统意义上来说,Z/OS的数据集的都是面向记录,有5种可能的格式。

In normal usage, there are no byte stream files such as are found in PC and UNIX® systems. (z/OS UNIX has byte stream files, and byte stream functions exist in other specialized areas. These are not considered to be traditional data sets.)
在一般的使用上,Z/OS是没有像PC和Unix系统的上的字节流文件(Z/OS Unix有字节流文件,而这些字节流功能存在其他特定的功能区域,但是这些已经不是传统意义上的数据集了,另当别论)

In z/OS, there are no new line (NL) or carriage return and line feed (CR+LF) characters to denote the end of a record. Records are either fixed length or variable length in a given data set. When editing a data set with ISPF, for example, each line is a record.
在Z/OS中,没有新行符号(NL)或者(CR+LF) 等字符作为记录的结束标志。在一个给定的数据集,记录总是固定长度的或者是可变长度的。

Traditional z/OS data sets have one of five record formats, as follows:
传统Z/OS有下面5中的记录格式:

F (Fixed)
Fixed means that one physical block on disk is one logical record and all the blocks and records are the same size. This format is seldom used.
F(固定)
       在磁盘的上一个物理块就是一个逻辑记录,而且所有的块和记录都是同样大小的,这种格式是很少用的了。

FB (Fixed Blocked) 
This format designation means that several logical records are combined into one physical block. This format can provide efficient space utilization and operation. This format is commonly used for fixed-length records.
FB(定长 分块)
    这种格式意味着几个逻辑记录组合成为一个物理块,这种格式能够提供高效的空间利用率和操作行,是一种经常被固定长度记录使用的格式。

V (Variable) 
This format has one logical record as one physical block. A variable-length logical record consists of a record descriptor word (RDW) followed by the data. The record descriptor word is a 4-byte field describing the record. The first 2 bytes contain the length of the logical record (including the 4-byte RDW). The length can be from 4 to 32,760 bytes. All bits of the third and fourth bytes must be 0, because other values are used for spanned records. This format is seldom used.
V(变长)
      这种格式中,一个逻辑的记录作为一个物理块,一个可变长度的逻辑记录包含一个记录描述符(RDW),它放置在在数据的前面。这个记录描述符有4个字节,前两个字节描述了逻辑记录的长度(长度也包含了RDW的长度在内)。长度范围可以是4字节到32760个字节,第三和第四个字节必须是0,因为其他值已经被跨越式的记录使用,这种格式也是很少使用的。

VB (Variable Blocked)
This format places several variable-length logical records (each with an RDW) in one physical block. The software must place an additional Block Descriptor Word (BDW) at the beginning of the block, containing the total length of the block.
VB(变长,分块)
       这种格式将多个可变长度的逻辑记录(每一个都包含了RDW)放在一个物理块里面。系统必须放置一个额外的块描述符(BWD)在块的开始部位,BDW它包含了这个块全部长度。

U (Undefined) 
This format consists of variable-length physical records and blocks with no predefined structure. Although this format may appear attractive for many unusual applications, it is normally used only for executable modules.
U(未定义)
       这个格式包含了可变长度的记录和没有预先定义好格式的块,这种格式对于那些不常用的应用程序是多么的吸引,但是一般来说,主要用于可执行模块的存储格式。

We must stress the difference between a block and a record: a block is what is written on disk, while a record is a logical entity.
我们这里需要强调一个块和一个记录的区别,一个块是用于写入磁盘,而一个记录是一个逻辑实体。
The terminology here is pervasive throughout z/OS literature. The key terms are:
这些技术词汇贯穿了Z/OS技术文化里面中,下面是关键的一些项目:
Block Size (BLKSIZE) is the physical block size written on the disk for F and FB records. For V, VB, and U records, it is the maximum physical block size that can be used for the data set.

块大小(BLKSIZE),是指用于写入F或者FB格式的物理块的大小。而对于V,VB和U格式的记录,BLKSIZE是数据集能够使用的最大物理块大小。
Logical Record Size (LRECL) is the logical record size (for formats F and FB) or the maximum allowed logical record size (for formats V and VB) for the data set. Format U records have no LRECL.
逻辑记录格式大小(LRECL)是指一个逻辑记录的大小(对于F和FB的格式)或是最大的可允许的逻辑记录大小(对于V和VB格式的)数据集,对于格式U来说,是没有LRECL可言的。

Record Format (RECFM) is F, FB, V, VB, or U as just described.
记录格式(RECFM)F, FB, V, VB, or U,上面已经讲过了
These terms are known as data control block (DCB) characteristics, named for the control block where they may be defined in an assembly language program. The user is often expected to specify these parameters when creating a new data set. The type and length of a data set are defined by its record format (RECFM) and logical record length (LRECL). Fixed-length data sets have a RECFM of F, FB, FBS, and so on. Variable-length data sets have a RECFM of V, VB, VBS, and so on.

这些项目就是我们知道的(DCB)数据控制块,被命名的DCB常用于汇编程序,当我们需要创建新的数据集的时候,我们经常需要指明这些项目的数值。数据集的类型和长度由它的记录格式(RECFM)和逻辑记录长度(LRECL)来决定的。固定长度的数据集有记录格式(RECFM)F, FB等等其他,可变长度的数据集有记录格式(RECFM)V, VB, VBS,等等其他

A data set with RECFM=FB and LRECL=25 is a fixed-length (FB) data set with a record length of 25 bytes (the B is for blocked). For an FB data set, the LRECL tells you the length of each record in the data set; all of the records are the same length. The first data byte of an FB record is in position 1. A record in an FB data set with LRECL=25 might look like this:
Positions 1-3: Country Code = 'USA'
Positions 4-5: State Code = 'CA'
Positions 6-25: City = 'San Jose' padded with 12 blanks on the right
使用了RECFM=FB and LRECL=25进行定义的数据集是一个固定长度的数据集,数据集的记录长度为25个字节,B意味指分块的,在一个FB格式的数据集中,LRECL项告诉了你这个数据集每个记录的长度,他们长度都是一样的,如上面的记录。

A data set with RECFM=VB and LRECL=25 is a variable-length (VB) data set with a maximum record length of 25 bytes. In a VB data set, the records can have different lengths. The first four bytes of each record contain the RDW, and the first two bytes of the RDW contain the length of that record (in binary). The first data byte of a VB record is in position 5, after the 4-byte RDW in positions 1-4. A record in a VB data set with LRECL=25 might look like this:
定义为RECFM=VB and LRECL=25的数据集是一个可变长度的数据集,它最大的长度是25个字节,在一个定义为VB格式的数据集中,记录可以有不同的才长度,前面的四个字节是记录描述(RDW),前面两个字节包含了记录的长度(二进制表示),因此,可变长度的记录的开始的数据位是5,定义为VB格式,LRECL=25的数据集的一条记录会像下面这样保存。
Positions 1-2: Length in RDW = hex 0011 = decimal 17
Positions 3-4: Zeros in RDW = hex 0000 = decimal 0
Positions 5-7: Country Code = 'USA'
Positions 8-9: State Code = 'CA'
Positions 10-17: City = 'San Jose'
Figure 1 shows the relationship between records and blocks for each of the five record formats.

下面的图展示了,在不同格式下,5个记录和块的关系
Figure 1. Basic record formats 基本记录格式
posted on 2013-07-27 17:49 Eric_jiang 阅读(259) 评论(0)  编辑  收藏 所属分类: Mainframe

只有注册用户登录后才能发表评论。


网站导航: