The defined length of a varying length character string is treated as significant.
The string is not trimmed. This means that the user logic can pad the string with any desired characters, including the defined fill character or white space.
When a varying length string is output, the current length determines the significant portion of the data. The string occupies a substring which is left aligned within a space large enough to contain the maximum defined string length. However, only the current length is valid, and any characters beyond the current length are ignored.
If the length is larger than the defined maximum length, then the length should be reset to the maximum length. This prevents any storage violations, overlays, or other problems downstream. However, such a condition is suspect, and if some diagnostic reporting is available (such as tracing), then the condition is reported.
The defined substring is edited using the edit pattern defined for the field. This results in a varying length intermediate string.
The intermediate string is then translated to the terminal codepage. This may result in an intermediate string being longer or shorter than the intermediate string that is output from editing. After translation, the output string is output to the device and justified.
When a varying length string is input, it is translated into the application codepage, if needed. The variable is not padded with spaces. Instead, the computed length is set into the current length of the variable. The variable is padded with spaces to its maximum defined length to support COBOL comparisons, which are always for the maximum defined length.
|
Copyright © 2013 CA.
All rights reserved.
|
|