This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).
We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:
Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,
Post an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.
IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.
ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.
We are still having difficulty in understanding your requirement. You mentioned that the target CCSID of a variable can change on the fly, but the TGTCCSID parameter of the CRTRPGMOD and CRTBNDRPG commands only affects the CCSID that will be used to read the source. It does not affect the CCSID of any variables. The CCSID of any variable would always be the same, no matter what CCSID the source is processed in.
If a variable with CCSID X is loaded with data from a different CCSID Y, then that is a programming error. The RPG compiler would assume that the data was in the same CCSID as the variable, and if the compiler needed to do some CCSID conversion for assignment or parameter passing, it would assume that the data was in the assigned CCSID of the variable. You can't change the CCSID of a variable on the fly. The only time a variable has a CCSID that can change is when the variable is defined to have the job CCSID (that is the default). (But note that if the job CCSID changes while the program is running, RPG would assume that it was still the same as when any procedure in the module is first called.)
We don't understand what you mean by "bringing the CCSID from the client code into the open source project". That sounds like something that would be done with the source itself, but what you are describing with *TGTCCSID sounds like something that would be done when the program is running, when it is calling something (your APIs?).
- IBM Power Systems Development
The /SET directive only affects the CCSID of variables. It does not affect the CCSID of the literals in the source or the CCSID of the source lines.
All the lines in the source are read with the same CCSID. If a copy file has a different CCSID, the lines in the coup file are converted to the TGTCCSID.
If you want to know the CCSID of a particular variable, it would be better to request a built-in function such as %CCSID that would return the CCSID of a variable.
ctl-opt ccsid(*char : *jobrun);
dcl-s dft_ccsid_jobrun char(10);
/set ccsid(*char : 500)
dcl-s set_dft_ccsid_500 char(10);
dcl-s explicit_ccsid_utf8 char(10) ccsid(*utf8);
dcl-s dft_utf16 ucs2(*utf16);
/restore ccsid(*char)
If there were a %CCSID built-in function, and the job CCSID was 37:
%CCSID(dft_ccsid_jobrun) would return 37 (the job CCSID).
%CCSID(set_dft_ccsid_500) would return 500.
%CCSID(explicit_ccsid_utf8) would return 1208.
%CCSID(dft_utf16) would return 1200.
Would a %CCSID built-in function provide what you need?
Regarding the CCSID for OPTIONS(*STRING), please open another Idea to request that the CCSID keyword be supported for OPTIONS(*STRING).
- IBM Power Systems Development
If the IFS source is Unicode, with CCSID 1208, the TGTCCSID parameter would be needed to compile the source. For example, TGTCCSID(500). *SRCCCSID would be 1208 which might not be useful.
The TGTCCSID parameter can also be specified when compiling source from a source physical file. For example, a source file with CCSID 37 could be compiled with TGTCCSID(500). *SRCCCSID would be 37 which might not be correct.
The TGTCCSID parameter indicates the CCSID that the compiler uses to read the source, and it indicates the CCSID of the literals stored in the generated module.
Would it be better to have a way to get the target CCSID instead of the source CCSID?
- IBM Power Systems Development