View previous topic :: View next topic
|
Author |
Message |
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi all,
i need to write a program where we dont know the LRECL of the input file.
So i declare the File secftion like below,
Code: |
FD INPUT-FILE
RECORDING MODE V
RECORD VARYING 200 TO 7000 DEPENDING ON WS-RECORD-LENGTH
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD.
01 INP-RECORD PIC X(7000). |
I passed the lrecl of the input file through linkage section so that before opening the file
Code: |
WS-RECORD-LENGTH = 3000 |
and for testing purpose i run a job whose LRECL = 3000.
But the job abend because of file mismatch error.
So can anyone please let me know how to declare for FD in FILE SECTION for variable input file length. |
|
Back to top |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
Can you please post the error that you are getting |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The LRECL of the data set being referenced as INPUT-FILE must be 7004 bytes, 7000 for the record and 4 bytes for the RDW (Record Descriptor Word). If your file LRECL is not 7004 that would explain the file mis-match error. |
|
Back to top |
|
|
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi,
Actully I am writting a common module for most of the input file which are of different Lrecl.
Let's say 200, 2300, 6900
So hw to declare the FD section such that when the lrecl of 200 file was given as input at that time the Input-record in Cobol should contain 200 characters similarly for the rest.
This is the error that i got ,
Code: |
A file attribute mismatch was detected. File INPUT-FILE in program ***** was
and the file specified in the ASSIGN clause did not contain the same attribute.
A file attribute mismatch was detected. File INPUT-FILE in program ***** had
the file specified in the ASSIGN clause had a record length of 3000. |
is there any technique that can be used to do my requirement. |
|
Back to top |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
Your LRECL in jcl should have 7004 bytes with RECFM VB. And all the input files should also have the same LRECL and RECFM as VB, but the length of the records in the file can be from 200 - 7000 as mentioned.
Can you please post the JCL and also the attributes of the input files. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Not only has this topic been discussed multiple times here, session 8237 at Share in Austin had a detailed description of what is needed. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Why would somebody think that many FB files of different length is the same as one VB file? |
|
Back to top |
|
|
|