News
Abstract
Information about the PTFs to provide the ILE RPG enhancement to support implicit CCSID conversion for string built-in functions
Content
You are in: RPG Cafe Fall 2025: Implicit CCSID conversion for built-in functions
Short URL: https://ibm.biz/rpgcafe_fall_2025_ccsid_conv_bifs
Fall 2025: Implicit CCSID conversion for built-in functions
If the string operands have different types or CCSIDs for the following built-in functions, the compiler will handle the CCSID conversion for you.
- For %CHECK(valid_values : source), the valid_values parameter is converted to the type and CCSID of the source parameter.
- For %CHECKR(valid_values : source), the valid_values parameter is converted to the type and CCSID of the source parameter.
- For %LOOKUP(search_argument : array), the search_argument parameter is converted to the type and CCSID of the array parameter.
- For %SCAN(search_argument : source), the search_argument parameter is converted to the type and CCSID of the source parameter.
- For %SCANR(search_argument : source), the search_argument parameter is converted to the type and CCSID of the source parameter.
- For %SCANRPL(from_string : to_string : source), the from_string and to_string parameters are converted to the type and CCSID of the source parameter.
- For %SPLIT(source : split_characters), the split_characters parameter is converted to the type and CCSID of the source parameter.
- For %TLOOKUP(search_argument : table), the search_argument parameter is converted to the type and CCSID of the table parameter.
- For %TRIMx(source : trim_characters), the trim_characters parameter is converted to the type and CCSID of the source parameter.
- For %XLATE(from_characters : to_characters : source), the from_characters and to_characters parameters are converted to the type and CCSID of the source parameter.
Prior to this enhancement, if the string parameters had different types or CCSIDs, you would have to code %CHAR or %UCS2 or or %GRAPHfor one of the parameters.
With this enhancement, the compiler converts the city variable to UCS-2 before doing the %SCAN.
dcl-s address ucs2(50); dcl-s city char(20); dcl-s p int(10); p = %scan (city : address); // Before: Error, type mismatch. Now, ok. p = %scan (%ucs2(city) : address); // Before and now, ok. But ugly.
If you use Control keyword CCSID(*EXACT), you might have even had to code %CHAR for a literal used with a CHAR variable. With CCSID(*EXACT), character literals have the same CCSID as the source (or more specifically, the same CCSID as the TGTCCSID parameter for your compile). But CHAR variables usually have the job CCSID.
With this enhancement, the compiler converts the ' ' literal from the source CCSID to the job CCSID before the %SCAN.
ctl-opt ccsid(*exact);
dcl-s name char(50);
dcl-s p int(10);
p = %scan (' ' : name); // Before: Error, CCSID mismatch. Now, ok
p = %scan (%char(' ') : name); // Before and now, ok. But ugly.
. .
. .
PTFs for 7.5, and 7.6
7.5:
- ILE RPG compiler: 5770WDS SJ08064
7.6:
- ILE RPG compiler: 5770WDS SJ08065
- ILE RPG compiler, TGTRLS(V7R5M0): 5770WDS SJ08092
RDi support
A later update for RDi will support this enhancement.
Documentation
The 7.5, and 7.6 ILE RPG Reference and ILE RPG Programmer's Guide are updated with full information about this enhancement. Start at the What's new since 7.5", or What's new since 7.6" section in the Reference.
- What's new since 7.5? https://www.ibm.com/docs/en/ssw_ibm_i_75/rzasl/rpgrelv7r5post.htm
- What's new since 7.6? https://www.ibm.com/docs/en/ssw_ibm_i_76/rzasl/rpgrelv7r6post.htm
Was this topic helpful?
Document Information
Modified date:
18 November 2025
UID
ibm17246939