VLSCMP or NOVLSCMP
_____________________________________________________________________
| |
| >>__ _VLSCMP___ ________________________________________________>< |
| |_NOVLSCMP_| |
| |
|_____________________________________________________________________|
Temporarily overrides the VLSCMP installation option, which specifies whether DFSORT is to pad "short" variable-length INCLUDE/OMIT compare fields with binary zeros. A short field is one where the variable-length record is too short to contain the entire field, that is, the field extends beyond the record. VLSCMP and NOVLSCMP apply to the INCLUDE and OMIT statements and to the INCLUDE and OMIT parameters of the OUTFIL statement.
The compare fields are only padded temporarily for testing; they are not actually changed for output.
VLSCMP is not meaningful for fixed-length record processing.
The settings for VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT provide three levels of processing for short INCLUDE/OMIT fields in the following hierarchy:
VLSCMP allows all of the INCLUDE/OMIT comparisons to be performed even if some fields are short. Because short fields are padded with binary zeros, comparisons involving short fields are false (unless a test against binary zero is relevant, as discussed below). Comparisons involving non-short fields can be true or false.
NOVLSCMP and VLSHRT treat the entire INCLUDE/OMIT logical expression as false if any field is short. Thus comparisons involving non-short fields are ignored if any comparison involves a short field.
NOVLSCMP and NOVLSHRT result in termination if any field is short.
To illustrate how this works, suppose the following INCLUDE statement is used:
INCLUDE COND=(6,1,CH,EQ,C'1',OR,70,2,CH,EQ,C'T1')
If a variable-length input record has a length less than 71 bytes, the field at bytes 70-71 is short and the following occurs:
With VLSCMP, the record is included if byte 6 of the input record is C'1' or omitted if byte 6 is not C'1'. The comparison of bytes 70-71 equal to C'T1' is false because bytes 70-71 contain either X'hh00' (for a record length of 70 bytes) or X'0000' (for a record length of less than 70 bytes). The comparison involving the non-short field is performed even though a short field is present.
With NOVLSCMP and VLSHRT, the record is omitted because any short field makes the entire logical expression false. The comparison involving the non-short field is not performed because a short field is present.
With NOVLSCMP and NOVLSHRT, DFSORT terminates because any short field results in termination.
In general, comparisons involving short fields are false with VLSCMP. However, if a binary zero value is relevant to the comparison, the use of binary zeros for padding might make the comparison true. For example, suppose the following INCLUDE statement is used:
INCLUDE COND=(21,2,CH,EQ,C'JX',OR,
(55,2,CH,EQ,58,2,CH,AND,
70,1,BI,LT,X'08'))
If a variable-length input record has a length less than 70 bytes, the field at byte 70 is short and is padded to X'00'. This makes the comparison of byte 70 less than X'08' true even though byte 70 is a short field and so probably irrelevant.
Likewise, if a variable-length record has a length less than 55 bytes, the fields at bytes 55-56 and 58-59 are short and are each padded to X'0000', and the field at byte 70 is short and is padded to X'00'. This makes the comparison of bytes 55-56 equal to 58-59 true and the comparison of byte 70 less than X'08' true even though all three fields are short and probably irrelevant.
In such cases where padding of short fields with binary zeros may result in unwanted true comparisons, you can get the result you want by adding an appropriate check of the record length to the INCLUDE/OMIT logical expression, such as:
INCLUDE COND=(21,2,CH,EQ,C'JX',OR,
(1,2,BI,GE,X'0046',AND,
55,2,CH,EQ,58,2,CH,AND,
70,1,BI,LT,X'08'))
Now the comparisons involving bytes 55-56, 58-59 and 70 can only be true for records that are 70 bytes (X'0046') or longer. Thus, the irrelevant comparisons involving short fields are eliminated.
Keep in mind that short compare fields are padded with zeros when VLSCMP is in effect and code your INCLUDE/OMIT logical expressions to allow for that or even take advantage of it.
VLSCMP
specifies that short variable-length compare fields are padded with binary zeros.
NOVLSCMP
specifies that short variable-length compare fields are not padded.
Default: Usually the installation default. See Appendix B, "Specification/Override of DFSORT Options" in topic B.0 for full override details.
Applicable Functions: See Appendix B, "Specification/Override of DFSORT Options" in topic B.0.
Partager