Frank Swarbrick wrote:
We have a program that has the following in it:
SELECT CVSCATF
ASSIGN TO AS-CVSCATF
ACCESS IS SEQUENTIAL
FILE STATUS IS FILE-STATUS.
FD CVSCATF
RECORD CONTAINS 17 TO 69 CHARACTERS.
01 CVSCATF-RECORD PIC X(69).
01 CVSCATF-RECORD-L7 PIC X(17).
OPEN I-O CVSCATF
READ CVSCATF INTO CVSC-AAT-RECORD
...change something here...
REWRITE CVSCATF-RECORD FROM CVSC-AAT-RECORD
(Yes, we do check FILE-STATUS after each I-O.)
Some of the records are 17 characters and some are 69. The file is a VSAM
ESDS. CVSC-AAT-RECORD is a group data item that is *not* varying in length.
This program works.
We then change CVSCATF is to a regular sequential file and change the SELECT to
remove the AS- prefix
Now when we read a 17 byte record and try to REWRITE it we get an error with
FILE STATUS 44, which means:
"A boundary violation exists because an attempt was made to rewrite a record to a
file and the record was not the same size as the record being replaced, or an attempt was
made to write or rewrite a record that was larger than the largest or smaller than the
smallest record allowed by the RECORD IS VARYING clause of the associated file-name."
Obviously it's trying to rewrite it as 69 bytes in to a record that was
previously only 17 bytes.
This can be fixed for the sequential file by adding RECORD IS VARYING DEPENDING
ON CVSCATF-REC-LEN to the FD and creating CVSCATF-REC-LEN in working-storage.
My question is, why does it work when the file is VSAM, even without the RECORD
IS VARYING?
Thanks,
Frank
Question: are you running your tests under VSE or z/OS?
--
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-393-8716
http://www.trainersfriend.com
z/OS Application development made easier
* Our classes include
+ How things work
+ Programming examples with realistic applications
+ Starter / skeleton code
+ Complete working programs
+ Useful utilities and subroutines
+ Tips and techniques
==> Ask about being added to our opt-in list: <==
==> * Early announcement of new courses <==
==> * Early announcement of new techincal papers <==
==> * Early announcement of new promotions <==
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html