View previous topic :: View next topic |
Author |
Message |
veeru_ch Beginner
Joined: 11 Dec 2003 Posts: 4 Topics: 2
|
Posted: Sun Apr 22, 2007 2:46 pm Post subject: Header and Trailor |
|
|
Hi,
Can any one explain me what is use of header and trailor records in a file. This is an interview question.
Thanks in Advance
Veer |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Sun Apr 22, 2007 3:19 pm Post subject: |
|
|
A Header record would contain information that would differentiate this file from other files - date, etc - is made up of info known at the begining of he process that created the file. A header record is the the first record in the file.
A Trailer record would contain statistics about the file that were accumulated during the process that created the file- counts, amount totals , etc... A trailer record would be the last record in the file. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
veeru_ch Beginner
Joined: 11 Dec 2003 Posts: 4 Topics: 2
|
Posted: Mon Apr 23, 2007 3:49 am Post subject: |
|
|
Dick, Thanks for the quick reply, Is there is any possibility of having more than one trailor for a file. |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Apr 23, 2007 4:19 am Post subject: |
|
|
well, yeah. depends upon the original design. there maybe more data to pass with the trailer record than can fit in one record.
normally when a ds (dataset) has more than one record type, there is a common field, (often the first char) that defines the record type; for example:- 1 - header record
- 2 - detail record
- 3 - trailer record
This can obviously become more complex and require two char for the definition- 01 - header
- 02 - detail record type 1
- 03 - detail record type 2
- 04 - detail record type 3
- 12 trailer record with accumulated stats on detail record type 1
- 13 trailer record with accumulated stats on detail record type 2
- 14 trailer record with accumulated stats on detail record type 3
- 99 trailer record with accumulated stats on complete DS
Normally, a program that processes a DS which contains header/detail/trailer record, the individual trailer records are compare to accumulations to insure that number of records and totals in are equal to those output by the creating program. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Mon Apr 23, 2007 4:38 am Post subject: |
|
|
veeru_ch wrote: | Is there is any possibility of having more than one trailor for a file. |
Yes you can have. |
|
Back to top |
|
|
|
|