The RECFM (Record Format) parameter specifies the format and characteristics of records in a dataset. This parameter is crucial for defining how data is physically stored within datasets, affecting both storage efficiency and processing methods.
Key Benefit:
Properly specified RECFM ensures data integrity, optimal storage utilization, and compatibility with processing programs. It determines whether records have fixed or variable lengths and defines additional record attributes like blocking and control characters.
123//ddname DD DSN=dataset.name, // DCB=(RECFM=xx,...), // ...other parameters...
Where xx
is a combination of one or more record format codes.
RECFM values are composed of one or more of the following codes, combined to define the complete record format:
Code | Description | Usage |
---|---|---|
F | Fixed-length records | All records have the same length, specified by LRECL |
V | Variable-length records | Records can have different lengths, up to the maximum specified by LRECL |
U | Undefined-length records | Records have no defined format; often used for load modules |
Modifier | Description | Compatible With |
---|---|---|
B | Blocked records | F, V (e.g., FB, VB) |
S | Standard format (for F) or Spanned (for V) | F, V (e.g., FS, VS) |
A | ASA print control characters | F, V (e.g., FBA, VBA) |
M | Machine print control characters | F, V (e.g., FBM, VBM) |
T | Track overflow | F, V (seldom used in modern systems) |
Combination | Description | Common Uses |
---|---|---|
FB | Fixed-length, blocked records | Most common format for data files, source code libraries |
VB | Variable-length, blocked records | Text files, log files, output from programs with varying record sizes |
FBA | Fixed-length, blocked, ASA control characters | Print files and reports with ASA carriage control |
VBA | Variable-length, blocked, ASA control characters | Reports with varying line lengths and ASA control |
U | Undefined record format | Load modules, executable programs, binary data |
VBS | Variable-length, blocked, spanned records | For records that can exceed the LRECL and span multiple blocks |
Fixed-length records all have the same length, specified by the LRECL parameter. For example, with RECFM=FB and LRECL=80:
Fixed-Length (F) Record Structure:
┌────────────────────┐ │ Record 1 (80 bytes)│ ├────────────────────┤ │ Record 2 (80 bytes)│ ├────────────────────┤ │ Record 3 (80 bytes)│ └────────────────────┘
Variable-length records include a 4-byte Record Descriptor Word (RDW) at the beginning of each record, containing the record length. For example, with RECFM=VB and LRECL=100:
Variable-Length (VB) Record Structure:
┌────┬──────────────────┐ │BDW │Block length │ ├────┼──────────────────┤ │RDW │Record 1 (varying)│ ├────┼──────────────────┤ │RDW │Record 2 (varying)│ ├────┼──────────────────┤ │RDW │Record 3 (varying)│ └────┴──────────────────┘
When 'A' (ASA) or 'M' (Machine) control characters are specified in RECFM, the first byte of each record contains a control character that indicates carriage control operations for printers:
ASA Character | Meaning |
---|---|
blank (' ') | Single space |
0 | Double space |
- | Triple space |
+ | No advance (overprint) |
1 | Form feed (new page) |
1234//SRCLIB DD DSN=USER.SOURCE.LIB, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(10,5)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=32720)
This example creates a new dataset with fixed-length blocked records, typically used for source code or data files with fixed record structures.
1234//LOGFILE DD DSN=USER.APPLICATION.LOG, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,2)), // DCB=(RECFM=VB,LRECL=1024,BLKSIZE=32760)
This example defines a log file with variable-length records, which allows flexibility in record sizes for logging varying message lengths.
1234//REPORT DD DSN=USER.MONTHLY.REPORT, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(1,1)), // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=13300)
This example defines a report file with ASA carriage control characters. The LRECL is 133 bytes: 1 byte for the ASA control character plus 132 bytes for the print line.
1234//LOADLIB DD DSN=USER.LOAD.LIBRARY, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(10,5,10)), // DCB=(RECFM=U,BLKSIZE=32760)
This example creates a library for executable load modules using the undefined record format, which is appropriate for binary executable programs.
123456789//IDCAMS EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER (NAME(USER.VSAM.KSDS) - RECORDSIZE(80 80) - /* LRECL specification */ INDEXED - KEYS(8 0) - CYLINDERS(5 1)) /*
For VSAM datasets, RECFM is implied by the dataset type (KSDS, ESDS, etc.) and is specified differently using RECORDSIZE.
Record format has significant implications for I/O performance and storage efficiency:
Issue | Possible Causes | Solutions |
---|---|---|
ABEND013-4C | DCB attribute conflict between JCL and dataset |
|
Truncated records | LRECL too small for data being written |
|
Corrupted print output | Incorrect or missing control characters |
|
I/O performance issues | Inefficient RECFM/BLKSIZE combination |
|
The RECFM parameter is part of the data management system rather than the job entry subsystem, so it functions identically in both JES2 and JES3 environments.
However, there are a few considerations regarding spool datasets:
Feature | JES2 | JES3 |
---|---|---|
SYSOUT handling | JES2 handles RECFM for SYSOUT datasets automatically | JES3 handles RECFM for SYSOUT datasets automatically |
Internal spool format | JES2 uses its own internal format | JES3 uses its own internal format |
Note:
When specifying RECFM for SYSOUT datasets, the settings may be used for external writers or post-processing programs, but JES itself manages the internal spool format.