On Monday, February 10, 2014 1:33:07 PM UTC, Keith wrote:
> Guy Greenwood wrote:
>
> > I need to write out large records (200KB) to an unstructured file using a COBOL program.
>
> > I have tried getting the program to create the file (the preferred method) but this failed with error 579 - The record size specified is too large for the given block size, file type and format.
>
> > I have also tried creating a file before running the program. This caused the program to abend with "environment corrupt".
>
> >
>
> > Surely this can't be too difficult can it ??
>
>
>
> Which COBOL compiler are you using? COBOL85, NMCOBOL, or ECOBOL?
>
>
ECOBOL
>
> Please post the SELECT and FD for the file.
>
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT LOG-FILE ASSIGN TO #DYNAMIC
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
FILE-STATUS IS WS010-FILE-STATUS.
DATA DIVISION.
FILE SECTION.
FD LOG-FILE.
01 LOG-FILE-RECORD.
03 LOG-FILE-BUFFER PIC X(189000).
>
>
> Can't be too difficult? Maybe not, but remember you are working with a system that was created in the days of 16-bit architecture and when 64KB of memory was big. It has progressed beyond those limits since then, but some of the defaults are left over from those early days -- the curse of compatibility. One of the defaults may be what is causing the problem.
I've tried compiling on S series and COBOL85 gives an error due to the size of the record:
23 01 LOG-FILE-RECORD.
24 03 LOG-FILE-BUFFER PIC X(189000).
25
** Error 189 ** 01 or 77 level data item too large for section: LOG-FILE-RECO