Our source is 65535, which has given me issues. I now spec the new compile option, COMPILEOPT('TGTCCSID(*JOB)'), and I haven't had any more problems.
That's about all I can say.
-----Original Message-----
From: David Gibbs [mailto:david@xxxxxxxxxxxx]
Sent: Wednesday, November 28, 2018 11:41 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: How does the SQL pre-compiler handle literals?
Folks:
Does anyone know the specifics of how the SQL pre-compiler handles text literals?
I'm particularly interested in how it handles different CCSID's.
Specifically, if I write & compile a program using CCSID 37 with a hard coded literal (say a regular expression), will the literal work when the program is run in a different CCSID that isn't aligned with 37?
I wrote & compiled the following code in CCSID 37 ... and it works fine in that CCSID.
dcl-s var1 varchar (128) inz(' ABCDEFG '); dcl-s var2 varchar (128);
exec sql
set :var2 = REGEXP_SUBSTR(:var1, '\s+ab(cd)?efg\s*', 1, 1,'i',1);
I then ran it in CCSID 5026 and it also worked ... which I didn't expect (because lower case characters in 5026 don't align with 37).
On a side note ... where are literals stored when the pre-compiler generates source? For instance, in the above statement, where would the regular expression be stored? The only place I can see it is as a comment in the generated source.
Thanks!
david
--
IBM i on Power Systems: For when you can't afford to be out of business!
I'm riding 615 miles (Yes, you read that right) in the American Diabetes Association's Tour de Cure to raise money for diabetes research, education, advocacy, and awareness. You can make a tax-deductible donation to my ride by visiting
https://mideml.diabetessucks.net.
You can see where my donations come from by visiting my interactive donation map ...
https://mideml.diabetessucks.net/map (it's a geeky thing).
I may have diabetes, but diabetes doesn't have me!
As an Amazon Associate we earn from qualifying purchases.