View previous topic :: View next topic
|
Author |
Message |
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
Hi,
I am trying to compare two files say, F1 and F2 and writing it to an output file say F3 based on a matching KEY field of 9 bytes. (using easytrieve plus)
F1 and F2 are VB files with LRECL = 8364 bytes and sorted based on key field.
F1 and F2 have record length of 3320 only though their LRECL is 8364 bytes.
Hence output record should also have record length of 3320 bytes with the file LRECL as 8364 bytes.
But actually records in output file is having largest length i.e 8364 bytes though input file is having record length of 3320 bytes.
i.e after 3320, low-values are populated.
This is creating problem in downstream as I need to have records of 3320 bytes only.
is there any way we can calculate length of each record before writing the output file?
Please let me know if my question is not very clear. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
review Your understanding of the DCB attributes...
For VB datasets ( variable blocked ) the lrecl specified in the dcb has nothing(almost)
to do with the length of individual records
it is the longest length to expected,
if the program is well written You will get records of the right length even if
the dcb info specifies a bigger one
( always wise to do it )
not thread related
I wonder why on these forums there are so many VB datasets when
from the discussion comes out that the records are really fixed length |
|
Back to top |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
ok. thx |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
... after 3320, low-values are populated. |
I had not seen the quote,
but as a general point in any decently written program / jcl two things
should be carried along...
the DCB info ( as I said before irrelevant as far as the single record content/layout)
as in this case the unaltered single record length/content/layout
if the record length gets changed to the maximum record length
and the unused area filled with low values
there is certainly a flaw in the application processing
or processing parameters |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
not thread related
I wonder why on these forums there are so many VB datasets when
from the discussion comes out that the records are really fixed length |
My guess is the system designers think it provides flexibility by not tying the design to one fixed record length. Of course if nobody supporting the system understands the VB file, I'm not sure there's enough gained to make it worthwhile. |
|
Back to top |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
Hi Robert/enrico
I added below statements in the program and it is working fine.
Code: |
FILEB:RECORD-LENGTH = FILEA:RECORD-LENGTH
PUT FILEB FROM FILEA |
FILEA -> Input file
FILEB -> Output file
Thanks |
|
Back to top |
|
|
|