|
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 SQL37, it works.
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
However, I need to find a way to correct this without changing37 but that didn't help.
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
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
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.