|
I ran it in debug and see this in the job log:
Character conversion between CCSID 1208 and CCSID 65535 not valid.
Here are the two errors:
Message ID . . . . . . : CPD434A
Date sent . . . . . . : 10/13/22 Time sent . . . . . . :
09:09:12
Message . . . . : Coded Character Set Identifiers (CCSIDs) of field *N
and
*N are not compatible.
Cause . . . . . : Field *N in file *N in library *N format *N join
reference
0 is mapped to field *N in format FORMAT0001. However, the CCSIDs of
the
two fields are not compatible because of reason code 2.
1 -- CCSID 1208 was not found.
2 -- Conversion between the job or program CCSID 1208 for field *N to
CCSID 65535 for field *N is not defined.
If the file name is *FUNCTION, the file was user-defined table
function *N
Message ID . . . . . . : SQL0332
Date sent . . . . . . : 10/13/22 Time sent . . . . . . :
09:09:12
Message . . . . : Character conversion between CCSID 1208 and CCSID
65535
not valid.
Cause . . . . . : Character or graphic conversion has been attempted for
data that is not compatible. There is no conversion defined between
CCSID
1208 and CCSID 65535.
If one CCSID is 65535, the other CCSID is a graphic CCSID. Conversion
is
not defined between 65535 and a graphic CCSID.
Well, normally if your job is running in 65535 this error would have the
two CCSIDs reversed, so what this is saying is that it can't convert from
it's own SQL variables (created by the SQL precomiler) to another one.
SQL_00005 129 230A VARYING CCSID(*HEX)
TOBEENCODED
SQL_00006 231 332A VARYING CCSID(*HEX)
TOBEENCODED
These are being defined incorrectly during compile... at least one of them
is. the field *N in the job log tells me it's the SQL fields in error... I
think
So, it's obvious I probably either have some setting wrong (which one, I
have no idea) or I need a PTF. I have compiled right from the command
line so that removes SBMJOB from the equation at least.
Any ideas from anyone?
On Thu, Oct 13, 2022 at 8:33 AM Brad Stone <bvstone@xxxxxxxxx> wrote:
I know I've used CCSIDs on variables before... not sure why this is
happening. I'm on the same OS version... TR 5.
On Wed, Oct 12, 2022 at 6:16 PM Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
The only difference seems to be that I used different variables for
the 'from' and 'to'.
Your compiler listing has *HEX for both; mine has *JOBRUNMIX for the
'from'.
--buck
On Wed, 12 Oct 2022 at 17:40, Brad Stone <bvstone@xxxxxxxxx> wrote:
option
D SQL_00005 129 230A VARYING CCSID(*HEX)
TOBEENCODED
SQL_00005 A(100) 78D 86M
VARYING(2)
CCSID(65535)
And in the source:
SQL_00005 = TOBEENCODED;
This is in my code as well (generated):
/SET CCSID(*CHAR:*JOBRUNMIX)
On Wed, Oct 12, 2022 at 4:33 PM Brad Stone <bvstone@xxxxxxxxx> wrote:
Interesting.. I have:
D SQL_00004 10 128A CCSID(*JOBRUNMIX)
D SQL_00005 129 230A VARYING CCSID(*HEX)
D SQL_00006 231 332A VARYING CCSID(*HEX)
I've never used the /set directive before... and there is no CCSID
wrote:on the CRTSQLRPGI command that I can find... SBMJOB CCSID is set to
*CURRENT and I know my job CCSID is 37 as is QCCSID System value.
On Wed, Oct 12, 2022 at 4:24 PM Buck Calabro <kc2hiz@xxxxxxxxx>
(ie,
On Wed, 12 Oct 2022 at 16:34, Brad Stone <bvstone@xxxxxxxxx> wrote:
Dcl-S SomeCharVar Varchar(50);
Dcl-S ToBeEncoded Varchar(100) Inz('') CCSID(1208);
SomeCharVar = 'hello db2 summit';
ToBeEncoded = SomeCharVar; //Convert it to 1208
//Encode based on 1208
EXEC SQL SET :ToBeEncoded = SYSTOOLS.BASE64ENCODE(:ToBeEncoded);
When I run it I get SQLCOD 332 and SQLSTATE 57017.
My job is CCSID 37. I've tripled checked that.
I do see in the SQL Precompiler it's creating some temp variables
itSQL_00000x) and they are defined as 65535.
Where would I find a more detailed error text showing what CCSIDs
CCSID(*JOBRUNMIX)thinks
it's trying to convert from and to?
Here is a similar program on 7.4 TR4:
dcl-s ch varchar(50);
dcl-s ch1208 varchar(100) ccsid(1208) inz;
ch = 'hello db2 summit';
exec sql set :ch1208 = systools.base64encode(:ch);
My compiler listing shows this:
Line <---------------------- Source
Number ....1....+....2....+....3....+
000100 // Set SQL Parameters
000100 /SET CCSID(*CHAR:*JOBRUNMIX)
000100 // SQL COMMUNICATION AREA
...
001000 D DS
SET
001000 D SQL_00000 1 2B 0 INZ(128)
length of header
001000 D SQL_00001 3 4B 0 INZ(4)
statement number
001000 D SQL_00002 5 8U 0 INZ(0)
invocation mark
001000 D SQL_00003 9 9A INZ('0')
CCSID(*JOBRUNMIX) data is okay
001000 D SQL_00004 10 128A CCSID(*JOBRUNMIX)
end of header
001000 D SQL_00005 129 180A VARYING
'iIWTk5ZAhILyQKKklJSJow=='CH
001000 D SQL_00006 181 282A VARYING CCSID(*HEX)
CH1208
dump(a) shows this:
CH CHAR(50) VARYING(2) 'hello db2 summit'
CH1208 CHAR(100) VARYING(2) CCSID(1208)
set
I'd check that the job/SBMJOB which compiles the RPG is also
CCSID(37), and if it is, brute force it by adding the RPG /SET to
relatedthe CCSID to *JOBRUNMIX.
Note: this is an RPG compiler function, not SQL!
https://www.ibm.com/docs/en/i/7.4?topic=directives-set#cdset
--buck
--
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
affiliatequestions.
Help support midrange.com by shopping at amazon.com with our
related questions.--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@xxxxxxxxxxxxxxxxxxxx for any subscription
affiliate link: https://amazon.midrange.com
Help support midrange.com by shopping at amazon.com with our
--
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.