This is intended as a guide to coding parameters on a DCB macro in the CSCI 465 class.
Parameters we always need
Data Set Organization. We always code this as PS for "Physical Sequential". There is no default.
Macro Format. This indicates how we are going to do input or output: Move or Locate mode. The possible values are GL, GM, PL, PM or a pair of values such as (GM,PL). There is no default.
Parameters we always code in CSCI 465
The value is the DD name from the DD statement in the JCL representing the data set.
Device Type. We always code this as DA for "Direct Access". DA is actually the default value.
Parameters we sometimes need
Recording Format. We normally code this as F, FA, FB or FBA, where F = fixed-length records, B = blocked records (i.e., more than one logical record per block) and A indicates that each record starts with an ASA carriage control character.
Note: We need carriage control characters only if the records are going to the printer.
Logical Record Length. The value is 1 to 3760.
Block Size. This should be a multiple of LRECL. The value is 1 to 3760.
Note: We need BLKSIZE only for a blocked data set, that is, only if RECFM includes a B.
End of Data Address. The value is the label (or address) of an internal subroutine to be executed when a GET encounters end-of-file. The subroutine is normally very short and ends with BR 14 as usual.
Note: This is obviously needed only for an input data set.
Why don't we always need LRECL, etc.?
DCB information can be coded on a DD statement in the JCL as well as in a DCB macro. There is no point in listing it twice.
An existing data set (for instance, an input data set) has a "label record" which stores some information about the data set, including the LRECL, BLKSIZE (if there is one) and RECFM.
Forward Merge Process
When the assembler is collecting DCB data, it looks for it in the DCB macro. If it does not find what it needs, then we have some items missing. When are these supplied? At run time, the DD statement for the data set becomes available, and the missing DCB values may be found there. If not, then the remaining source of information is the label record, which will be read when the data set is opened.
If a conflict is discovered between the DCB parameters in the DCB macro or in the DD statement and the DCB parameters listed in the label record, the result is an ABEND with a File Status value of 39.
Important Trivia
The DCB macro does not generate any executable code. It does generate storage (DS and DC statements) and it puts values in them.
It is possible to change the values stored in a DCB macro's storage fields later if we wish. (This does not come up in CSCI 465.)
The DCB macro also has numerous other possible parameters, and some of the parameters listed above can have multiple other values or formats.
If we are creating a new data set with RECFM=FB and we provide LRECL but omit BLKSIZE, the system will determine a block size for us.
You can read about all this in Macro Instructions for Data Sets.