× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks, Barbara.

I actually found the issue was a bug, and installed a PTF and got to chat
with support a little bit.

Encode unicode... Decode returns 65535. Sort of weird if you ask me, but
with CCSID support for variables that should make converting from one to
any pretty darn simple. :)

Of course, the issue I am seeing is people don't change their default CCSID
from 65535 and don't understand why some things don't work. Then when you
suggest to change to the right CCSID for their location, they get scared
about changing a system value.



On Fri, Oct 14, 2022 at 5:44 PM Barbara Morris <bmorris@xxxxxxxxxx> wrote:

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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.