View previous topic :: View next topic
|
Author |
Message |
Appu
New User
Joined: 26 Apr 2010 Posts: 73 Location: India
|
|
|
|
Hello Team,
I am facing one issue while reading a Variable record file in COBOL and PL/1. The record length of the file is 4064 which is getting read to a 4064 char varying in pl/1. But I was surprised to see in one single read COBOL is taking data from next row also.
Input file ( 4 records )
----------------------------
Record with length 4060
Record with length 4008
Record with length 4059
Record with length 2822
Reading in COBOL
-------------------------
Read1 : 1st record read
Read2 : 2nd record + 52 chars from record 3
Read3 : 3rd record read
Read 4: 4th record read
Reading in PL/1
-------------------------
Read1 : 1st record read
Read2 : 2nd record read
Read3 : 3rd record read
Read 4: 4th record read
Can anyone tell me why in COBOL in 2nd read, it reads the rest of teh characters from next record. Is there any option to do the same in PL/1.
The declaration for teh files in cobol and pl/1 are as follows:
PL/1
DCL INFILE FILE RECORD ENV(VB RECSIZE(4064));
COB
FD INFILE
RECORDING V
BLOCK 0 RECORDS.
Please comment. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
the issue you are facing is lack of understanding.
Reading the manuals will correct that issue
1. for the COBOL:
not knowing your select statements,
your record definition in your fd statements
your read statement
I will still say:
cobol is not reading 52 chars from record 3
a cobol variable length read, will only move the length of the record.
what you are seeing is left over from the previous read.
use the read into work-area option
and
initialize the work-area to spaces or low-values before each read
and you will see. |
|
Back to top |
|
|
|