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



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.

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.