|
On 2022-10-12 5:23 p.m., Buck Calabro wrote:
On Wed, 12 Oct 2022 at 16:34, Brad Stone <bvstone@xxxxxxxxx> wrote:
...
My compiler listing shows this:
Line <---------------------- Source
Number ....1....+....2....+....3....+
000100 // Set SQL Parameters
000100 /SET CCSID(*CHAR:*JOBRUNMIX)
000100 // SQL COMMUNICATION AREA
...
The RPG compiler has a very strange (aka wrong) default idea about the
CCSID of character variables. Instead of defaulting to the job CCSID,
they default to the mixed SBCS/DBCS CCSID related to the job CCSID.
If your job CCSID (or your default job CCSID) is 37, RPG assumes a
default CCSID of 937 for your character variables. Usually this doesn't
matter, but if you have x'0E' in the data, it is interpreted as a
shift-out (shifting out of SBCS mode into DBCS mode). DBCS mode ends
with the shift-out x'0F'.
To tell RPG to assume that character variables default to the actual job
CCSID, code Control keyword CCSID(*CHAR:*JOBRUN).
The SQL precompiler adds that /SET directive to ensure that the
variables it defines will have the same default as the RPG variables.
If you have CCSID(*CHAR:*JOBRUN), then the SQL precompiler will code
that in its /SET directive too.
I think it's a good idea to always code CCSID(*CHAR:*JOBRUN) in the
control statements.
--
Barbara
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.