Use the CHANGE keyword to change the value of consecutive bytes in a data-type file.
The length of the to-data and from-data lengths can be different. The data to the right of the from-data is shifted left or right to account for the difference in length. These changes can impact the data structure and can result in lost data. Use the REPLACE command to maintain record field integrity, because REPLACE does not shift data. When the field-name parameter is specified, both to-data and from-data are padded to the field-name's defined length, and no shifting of data occurs.
When used with the COPY command, the record's final variable length can be different from its original length if the to‑data is greater or less than the from‑data, and the record's defined length allows for the different record length.
When used with the UPDATE command, the record's final variable length remains unchanged.
If the new record's length is valid for the file, the new record is written with the new length. If the new length is less than the minimum allowable record length, the new record's rightmost bytes are padded with a character as specified by the PADCHAR keyword. The default value is x'00'. If the new length is greater than the maximum allowable record length, the data past the maximum record length is lost.
For fixed record lengths, the record is padded as described for variable lengths when the new record length is less than the required record length. The data is lost if the new length is greater than the record length.
When the data is truncated, the command returns a condition code equal to the value of the keyword TRUNCRC. You can specify the TRUNCRC or use the &BAT_TRUNCRC default value.
NOTE: When changing pack data, the sign code is maintained.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|