| Author |
Message |
   
Anonymous
| | Posted on Wednesday, Mar 3, 2004 - 14:20: | |
I have files with up to 25 different "record types" per file a la: rec_type_A.field1 rec_type_A.field2 rec_type_A.field3 rec_type_A.field4 rec_type_B.field1 rec_type_B.field2 rec_type_B.field3 rec_type_B.field4 rec_type_B.field5 rec_type_B.field6 ... if none of the record types fits into the remaining BLOCK_NO*BLOCK_SIZE it is put in the next block, and so forth. It needs to recognize the "record types" which can be done by the first 3 bytes of each record type. This "key" consists of 2 bytes for the length of the record and 1 byte for the "type". For example, the file starts with a header, so I started with this template. requires 0 "290000" begin // HEA hex 2 "RECORD_LENGTH" hex 1 "RECORD_TYPE" hex 1 "CHARGING_BLOCK_SIZE" hex 2 "TAPE_BLOCK_TYPE" hex 2 "DATA_LENGTH_IN_BLOCK" hex 10 "EXCHANGE_ID" hex 4 "FIRST_RECORD_NUMBER" hex 4 "BATCH_SEQUENCE_NUMBER" hex 2 "BLOCK_SEQUENCE_NUMBER" hex 3 "START_TIME" hex 4 "START_DATE" hex 6 "FORMAT_VERSION" end The record type following the header may be any of the other 24 types. The "signature" for the header is "290000" and the next record has 33 fields and the "signature" "880009". How can I best reflect that in a template? Thanks in advance. |
|