CA Compress RDL provides the capability for defining multiple record formats for a file, where the format of an individual record can be determined from the contents of a field within the record by coding RDL specifications in a special structure, the condition group.
The general form of a condition group follows:
(nv,f,...,f)
|
Parameter |
Description |
|---|---|
|
n |
A 2-digit number, indicating the length of the field that is tested. |
|
v |
A value for comparison, n bytes in length. |
|
f |
Any RDL specification or repetition group. |
If the current n bytes in the input record being processed are equal to the value v, then the remaining definitions within the parentheses apply to the record; otherwise, they are skipped.
The value coded for v can consist of any of the 256 possible byte values, but you have to set the edit screen to hexadecimal to enter nongraphic values.
For readability, you can code the value v in hexadecimal format. To do so, code an X before the length specification n, and code the value as pairs of hexadecimal digits. For readability, leave spaces between pairs of hexadecimal digits. For example, the following 2 condition group specifications are equivalent:
(03XYZ,C1F80) (X03E7E8E9,C1F80)
A series of consecutively coded condition groups which are not separated by a comma (that is, separated by 1 or more blanks) indicates that the first condition group in the series whose condition is met applies to the record being processed, and the remaining condition groups in the series are skipped. For example, consider a hypothetical elementary invoicing file. Assume this file consists of sets of records, where each set of records represents 1 invoice. Each set of records consists of a header record, 1 or more detail records and a trailer record. The following image illustrates these records and the fields contained in them.

The following RDL specifications define these records and show the use of condition groups:
ZRF8,(01H,C1F8,GAF23)b(01D,C2F20,PDF4,PDF7)b(01T,GAF20,PDF4,PDF7).
It is important that alternative condition groups in a series be separated from one another by 1 or more blanks—not a comma. The comma is used to separate the last condition group in a series from any RDL specifications (which could be another condition group) that follow.
To show this point, consider the sample RDL specifications above, describing the records in Invoicing File Record Set. Suppose a comma separated the first condition group from the second condition group. Then if a record whose RECORD TYPE field contained an H was encountered, the first condition group applies. But after processing the C1F8,GAF23 RDL specifications, the following condition groups are not skipped. CA Compress expects more data beyond the filler at the end of the record, looking to compare for a D, according to the next condition group. Because the record definitions do not accurately define the record that is processed, unpredictable results may occur.
If the file contains a record whose record type is not H, D or T, CA Compress will abend with a user code of 15 and the message REC DEFS IMPLY WRONG LENGTH. This occurs because no record definitions are specified past the invoice number for any record whose record type is neither H, D nor T. You can avoid this situation by coding a default condition group at the end of the condition group series.
It is permissible (and frequently necessary) to code a default condition group at the end of a series of condition groups. Such coding supplies a set of record definitions if none of the preceding condition group tests are met and the actual content of the byte(s) in the record being tested is not known. The general form of a default condition group is the following: (00,f,...,f). In this expression:
|
Parameter |
Description |
|---|---|
|
00 |
is coded exactly as shown. |
|
f |
is any RDL specification or repetition group. |
A condition group coded in this form means that the RDL specifications in the condition group apply, no matter the contents of the current byte in the record being processed. Any default condition group coded in a series of condition groups must be coded as the last in the series. To show this procedure, the following definition can be coded to describe the records in Figure 2-1. Invoicing File Record Set.
ZRF8,(01H,C1F8,GAF23)b(01D,C2F20,PDF4,PDF7)b(01T,GAF20,PDF4,PDF7)b(00,C3F32).
If you omit coding a default condition group as the last condition group in a series, CA Compress automatically supplies the default condition group (00). This procedure indicates that if none of the preceding condition groups apply for a particular record, any RDL specifications following the condition group series apply beginning at the current byte location in the record. This is the same byte location within the record which the preceding series of condition groups tested. To show this point, note that the following 2 sets of RDL specifications are equivalent:
ZRF8,(01H,C1F8,GAF23)b(01D,C2F20,PDF4,PDF7)b(01T,GAF20,PDF4,PDF7)b(00,C3F32).ZRF8,(01H,C1F8,GAF23)b(01D,C2F20,PDF4,PDF7,)b(01T,GAF20,PDF4,PDF7),C3F32.
The maximum number of condition groups that can be coded in a series is 16, including the final default condition group, whether user-specified or automatically provided by CA Compress. The maximum number of condition group series that can be coded is limited only by the amount of space available in the FDT.
If the condition specified in a condition group is met, the value specified in the condition group and found in the record is compressed to 4 bits, regardless of the length of the value. No separate RDL specification is used to compress the value. The lengths of the values can differ within a condition group series.
| Copyright © 2012 CA. All rights reserved. |
|