If records are not spanned, then each record must fit in a block. Because of the block length information, the record length must be at least 4 less than the block length.
With spanned records, records can be segmented and so spread over more than one block. This allows the record length to be bigger than the blocksize. The length field in a record contains a segment length and segment control information.
The four bytes of record length information are included in the length of each variable length record. The first two bytes actually contain the record or segment length. The rightmost two bits of the third byte contain segment control information. If the these bits are zero for all records, then the file contains no spanned records.
Note that since zero in the segment control information indicates a complete record, you can specify RECFM=VBS for a VB dataset if you are in doubt. The LRECL value represents the largest record length - you can specify a larger value if you are not sure about the correct value initially.
One possiblity for analyzing record lengths for variable length data is to use the SORT utility. The following JCL:
Last Month's Topic