View previous topic :: View next topic
|
Author |
Message |
Joseph Keyes
New User
Joined: 21 Oct 2010 Posts: 2 Location: Califon, NJ
|
|
|
|
Greetings,
I'm stumped with this problem and hoping that someone had some insight. I am attempting to read this variable flat file as input:
FD OLDXXX-FILE
RECORDING MODE V
BLOCK CONTAINS 0 RECORDS
RECORD CONTAINS 599 TO 16501 CHARACTERS
LABEL RECORDS ARE STANDARD.
01 OLD-XXX-REC.
(The record contains a fixed portion and 7 variable portions, all of which add up to 16501)
OPEN file statement results in:
IGZ0201W A file attribute mismatch was detected. File OLDXXX-FILE in program PGMXXX had a record length of 16505 and the file specified in the ASSIGN clause had a record length of 16501.
Input file charateristics are:
General Data
Management class . . : **None**
Storage class . . . : **None**
Volume serial . . . : XXXD45
Device type . . . . : 3390
Data class . . . . . : **None**
Organization . . . : PS
Record format . . . : VB
Record length . . . : 16501
Block size . . . . : 16505
1st extent cylinders: 90
Secondary cylinders : 8
BROWSE reveals that the largest record on the file is 16497 bytes.
Thanks in advance,
Joe |
|
Back to top |
|
|
Abhishek_Indore
New User
Joined: 20 Oct 2010 Posts: 6 Location: INDIA->US->UK
|
|
|
|
Hi Joe,
Hope below comments will help you.
IGZ0201W A file attribute mismatch was detected. File file-name in program program-name had a record length of record-length-1 and the file specified in the ASSIGN clause had a record length of record-length-2.
Explanation: The program file description specified a record length that
did not match the record length of the data set associated with the ASSIGN clause. The OPEN statement failed.
Programmer Response: For Format-V and Format-S files the maximum record length specified in your program must be exactly 4 bytes smaller than the length attribute of the data set. For Format-F files, the record length specified in your program must exactly match the length attribute of the data set |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Basically, the compiler has provided the answer (unless you intend to change the process that creates the file. . .
You need to change the code to reflect the same length as the file. |
|
Back to top |
|
|
Joseph Keyes
New User
Joined: 21 Oct 2010 Posts: 2 Location: Califon, NJ
|
|
|
|
Thanks Messers Singh and Sherrer. The problem was indeed an incorrect record length originating with the IDCAMS flat file creation process. The O/P file LRECL was max length instead of maxlength + 4. I revisited my comment: "BROWSE reveals that the largest record on the file is 16497 bytes." and it all fell into place.
Thanks again,
Joe |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Take a look at this previous post -
www.ibmmainframes.com/viewtopic.php?p=250794&highlight=#250794
The example field WS-DR-LEN must be defined as a unsigned WS variable, your choice of data-type, but a binary-fullword is the best choice.
In the post, change the example RECORD CONTAINS to RECORD CONTAINS 599 TO 16501 CHARACTERS and name the length field to your choosing.
With that, technically you only need an 01 area defined as PIC X(16501) and after a READ, the unsigned length field will be set to the actual record-length.
This will work in COBOL2 and greater.
Bill |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
d |
|
Back to top |
|
|
|