There have been some changes to the way that the Gen runtime function SUBSTRDBCS works in Gen 7.6 GA and subsequent PTFs. This document describes the impact of those changes.
Release: 7.6 and later
SUBSTRDBCS for all runtime except for Blockmode and Server Runtime on z/OS was changed in Gen 7.6 GA to count using "character" instead of "byte" for the arguments of starting position and substring length.
SUBSTRDBCS for Blockmode and Server Runtime on z/OS is still counting using "byte" in Gen 7.6 GA, but PTF RTM76011/QO93484 changed that to count using "character" (the PTF also changes runtime function SUBSTRMIXED to work in the same way, but currently there is no plan to change SUBSTRMIXED for other platforms).
Before applying the PTF (Bold character is DBCS):
e.g. substrdbcs("1 2 3 4 5 6 7 8 9 A B C D E",9,4) will return "5 6"
After applying the PTF (Bold character is DBCS):
e.g. substrdbcs("1 2 3 4 5 6 7 8 9 A B C D E",9,4) will return "9 A B C"
The following table summarizes the SUBSTRDBCS functionality for Gen 7.6 before and after the PTF installation. The later Gen 8.x releases also have the same functionality as Gen 7.6 with the PTF installed.
Packaging | .NET | Java | Windows GUI C Application | Online/Cooperative Server | ||
Windows GUI C Cooperative Client | z/OS/COBOL | Windows/C | Unix/C | |||
Before apply PTF | character | character | character | Byte | character | character |
PTF | None | None | None | RTM760111 | None | None |
After apply PTF | character | character | character | character2 | character | character |
1 RTM76011 is superseded by Runtime Consolidation PTF RTM76035/RO17214.
2 This is also the new functionality for SUBSTRMIXED (z/OS only). For distributed platforms SUBSTRMIXED counts in bytes for Gen 7.6 and continues to do so in later Gen versions.