View previous topic :: View next topic
|
Author |
Message |
vvmanyam
New User
Joined: 16 Apr 2008 Posts: 86 Location: Bangalore
|
|
|
|
Hi,
I have an issue in reading variable length file.
I have a file of RECFM VB and LRECL 1000.
When I read this file sequentially at some point of read, 2 3 lines are read for one read statement.
i.e.
Length of Line 1: 500
Length of Line 2: 650
Length of Line 3: 800
First Read Line1(1,500) + Line2(1,500) is read
Second Read Line2(501,150) + Line3(800) + Line4(1,50)
This is happening only for some records not for all
I have checked the HEX values which is spaces for all the unused bytes of all the records.
Please let me how I can resolve this issue?
Regards,
Balu |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Balu,
would you please give us the code for readingthe files. It seems that you are not initialize the records before reading it. |
|
Back to top |
|
|
vvmanyam
New User
Joined: 16 Apr 2008 Posts: 86 Location: Bangalore
|
|
|
|
Ekta,
I don't think it is problem with initialization because the next record details are read in the current read.
i have displayed the record after each read..
Balu. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Balu,
need to see the file attributes.
need to see your select statement
need to see your fd statements
need to see your read statement
if you are using the workarea option with the read (hope you are)
need to see the working-storage description of the workarea
If you are looking in the FD record area, you will see a blocks worth of data. as you issue reads, the fd record area will be pointed appropriately.
What are you using to determine the different types of records? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Are you using READ INTO and displaying the WORKING-STORAGE 01, or are you using READ and displaying the FD 01? Do you have a RECORD VARYING clause in your FD?
If you're displaying the FD 01 you're working in the buffer and you need to have a RECORD VARYING clause in the FD so you can use reference modification to only display the current record data; if you display the entire 1,000 bytes you may see more than the current record in the DISPLAY.
Note that none of this has any impact on your program execution. The current record will be processed as it should be; it is only the display that can show data from additional record(s) -- the program won't process that data until the next READ statement is executed. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
In the COBOL manual, review the optional FD clause for variable-length records - RECORD CONTAINS XXXX TO 1000 CHARACTERS DEPENDING ON "AN UNSIGNED WS FIELD", such as a PIC 9(05) COMP-3 definition or a PIC 9(08) COMP or COMP-5 definition. A PIC 9(05) DISPLAY-NUMERIC definition is also an option.
In fact, I believe this has been discussed on the forum previously.
Regards,
Bill |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
|