Care to elaborate on that answer?
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jerry
Adams
Sent: Saturday, December 14, 2019 5:34 AM
To: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: SQL issue with CCSID 65535
65535 is the wrong CCSID.
Jerry C. Adams
Don't think of me as old; just as outliving my warranty.
IBM i Programmer/Analyst
--
NMM&D
615-832-2730
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
smith5646midrange@xxxxxxxxx
Sent: Friday, December 13, 2019 10:05 PM
To: 'RPG programming on IBM i'
Subject: RE: SQL issue with CCSID 65535
Thanks. I hate to change it like that because if something happens to the
job before it gets to change it back, it now has the wrong CCSID.
Bummer.
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Vernon
Hamberg
Sent: Friday, December 13, 2019 11:05 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: SQL issue with CCSID 65535
The only way to fix this is to have true job CCSID that is not 65535 - that
CCSID means "no conversion".
So you CAN, in your program, do a CHGJOB - maybe with QCMDEXC in the RPG.
Get the current CCSID using a Retrieve Job Info API and restore it after
you've done your thing in the RPG programs.
HTH
Vern
On 12/13/2019 9:09 PM, smith5646midrange@xxxxxxxxx wrote:
I am working on an RPGLE program that is using the SQL
QSYS2.PARSE_STATEMENT. My job's CCSID is 65535 which is causing the
below SQL to fail with "Character conversion between CCSID 65535 and
CCSID 1200 not valid." Unfortunately, the error does not tell me
which field it is unhappy with. If I change my job's CCSID from 65535
to
37, it works.
However, I need to find a way to correct this without changing
profiles or the system value. This will be running on other company's
computers and I can't make them change these settings, mainly because
I don't know if it would impact any of their existing software. As
you can see, I have even tried to cast each of the result field to
CCSID
37 but that didn't help.
Can someone point me in the right direction? Is there a workaround?
with data as
( select cast(coalesce(name_type,' ') as char(10) ccsid 37) as
name_type,
cast(coalesce(name,' ') as char(10) ccsid 37) as name,
cast(coalesce(schema,' ') as char(10) ccsid 37) as schema,
cast(coalesce(column_name,' ') as char(10) ccsid 37) as
column_name,
name_start_position
from table(qsys2.parse_statement('select DS1.MONTHNO
from DIVSALES DS1
where DS1.MONTHNO = 1
order by DS1.DIVNO',
'*SYS', '*PERIOD', '*APOSTSQL'))
)
select name,
schema,
column_name,
name_start_position
from data
where name_start_position < (select min(name_start_position)
from data
where name_type = 'TABLE')
order by name_start_position
--
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@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
--
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@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
--
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@xxxxxxxxxxxx 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.