DD RECFM Parameter


Note! RECFM parameter is required only when we are creating a dataset.

The RECFM parameter is used to specify the record format for the new dataset. It specifies the structure of the records in the dataset, such as their length (fixed or variable) and storage structure (blocked or unblocked).

RECFM is an optional parameter.

Syntax -

BPAM Access Method (For PDS) - Valid record formats

DCB=(RECFM={U   } [A]
           {UT  } [M]
           {V   }
           {VB  }
           {VS  }
           {VT  }
           {VBS }
           {VBT }
           {VBST}
           {F   }
           {FB  }
           {FT  }
           {FBT })

Default - U

A Specifies the records contain ISO/ANSI control characters.
B Specifies the records are blocked.
F Specifies the records are fixed length.
M Specifies the records contain machine code control characters.
T Specifies the records may be written using the track-overflow feature.
U Specifies the records are undefined length.
V Specifies the records are variable length.

BSAM, and QSAM Access Methods (For PS) - valid record formats

DCB=(RECFM={U   } [A]
            {UT  } [M]
            {F   }
            {FB  }
            {FS  }
            {FT  }
            {FBS }
            {FBT }
            {V   }
            {VB  }
            {VS  }
            {VT  }
            {VBS }
            {VBT }
            {VBST})

Default - U

A Specifies the records contain ISO/ANSI control characters.
B Specifies the records are blocked.
F Specifies the records are fixed length.
M Specifies the records contain machine code control characters.
S For fixed-length records, indicates that the records are written as standard blocks.
For variable-length records, indicates that a record can span more than one block.
T Specifies the records can be written using the track-overflow feature, if required.
U Specifies the records are undefined length.
V Specifies the records are variable length.
Note: - A or M can be coded with any record format, such as: RECFM=FBA

Examples -


Scenario1 - Define a PS file with fixed-length records (80 bytes).

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=SYSDA,
//          SPACE=(TRK,(3,2),RLSE),
//          DCB=(DSORG=PS,RECFM=F,LRECL=80,BLKSIZE=1600)

Scenario2 - Define a PS file with variable-length records (160 bytes).

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=SYSDA,
//          SPACE=(TRK,(3,2),RLSE),
//          DCB=(DSORG=PS,RECFM=V,LRECL=160,BLKSIZE=1600)

Scenario3 - Define a PS file with fixed-length blocked records (80 bytes).

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=SYSDA,
//          SPACE=(TRK,(3,2),RLSE),
//          DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=1600)

Scenario4 - Define a PS file with unblocked records.

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=SYSDA,
//          SPACE=(TRK,(3,2),RLSE),
//          DCB=(DSORG=PS,RECFM=U)