I was asked this question from an internal source and I don't know the
answer myself, so I am hoping someone here does.
The business task is to be able to handle multiple varying-length
sequentially-accessed input files, each with different LRECL values,
from a single COBOL file definition, as can be done now with
fixed-length input files.
Current Enterprise COBOL (we're at V3.4) allows you to specify RECORD
CONTAINS 0 CHARACTERS in the FD for a file, but for fixed-format files
only. This specification allows the same FD definition to be used for
input files with different LRECL values in different jobs using the same
program.
The program, of course, must be prepared to recognize the different
input LRECL values and do something sensible with each one. In our case
we use an assembler subroutine to issue RDJFCB to find out what the
actual DCB LRECL is after OPEN (is there a COBOL way to do this?), and
then we use READ followed by a move with a range qualifier ("move
data-name (1:reclength) to ...") into the appropriate structure.
Why can't that same phrase (or an equivalent one) be used for
varying-length files? The Enterprise COBOL compiler gives the following
error if you try:
Or is there an alternative COBOL-only solution for varying-length files
that none of us have thought of yet? The solution of using an assembler
subroutine to do dynamic DCB control block building and I/O functions
has already been considered and rejected, even though assembler has to
be used now for the RDJFCB function.
TIA for any info you can provide.
Peter
This message and any attachments are intended only for the use of the addressee
and
may contain information that is privileged and confidential. If the reader of
the
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html