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



I would think, I said, you shouldn't do that, because when
writing/inserting into a table a new row, your program (the compiler)
should know that the column and the source variable have different CCSIDs,
and there should be an implicit translation. I have had some issues though
with that. For the sake of consistency, try to do that and see if it
works. In my case, when producing files to the IFS with RPG programs
that run under CCSID 037, I had to do this with C library functions like
write(). I have to declare a variable as UTF-8 to properly write to the
stream file, otherwise it will be written as CCSID 037, and since my stream
file is 1208, I get unreadable characters when I look at the file. This is
not the same as inserting a row with an SQL INSERT statement, but as of
what you have described, it may be good trying to have your source
variables as 1208.

If you are not having what you think you should have, give this a try and
let us know.

Several months ago I complained precisely about this problem with CCSIDs,
it's a pain in the spine.

JS



El jue, 1 ago 2024 a las 9:47, Art Tostaine, Jr. (<atostaine@xxxxxxxxx>)
escribió:

Javier: My from and to variables are both defined in tables using CCSID
1208. Do I need to create another intermittent variable?

If it helps describe what I'm trying to do we receive JSON and write the
data to IBM i tables. Then we need to create a CSV for international labels
to import in Fedex shipping program.

Art

On Thu, Aug 1, 2024 at 10:47 AM Javier Sanchez <
javiersanchezbarquero@xxxxxxxxx> wrote:

If your program is an embedded sql rpg:

Declare a variable like this:

dcl-s myUTF8Var char(50) ccsid(1208) inz; // ccsid(*utf8) works too.

The char(50) is only illustrative, give the same length as your table's
1208 column.

Then in your program, assign whatever to myUTF8Var, even literal strings.
The compiler generates under the hood a call to a conversion routine that
would translate what you are loading it with as UTF-8 and then use this
variable to insert or update your field. Personally I'd expect that not
doing this, the conversion should take place, but if not, better do this.

Try again and let us know.

El jue, 1 ago 2024 a las 8:34, Art Tostaine, Jr. (<atostaine@xxxxxxxxx>)
escribió:

I created a CSV of FILEA with iACS SQL and it looks right. My program
takes
FILEA, Adds some data and creates FILEB. FILEB didn't download right.
So
something is happening when my program runs. I tried CHGJOB CCSID(*HEX)
before I Ran it but that didn't work.

Art

On Thu, Aug 1, 2024 at 10:10 AM Javier Sanchez <
javiersanchezbarquero@xxxxxxxxx> wrote:

Try this one first: with iACS, download the file to your PC and then
inspect it with Notepad++ and see if the character shows correctly.

El jue, 1 ago 2024 a las 7:40, Art Tostaine, Jr. (<
atostaine@xxxxxxxxx
)
escribió:

Thanks for the reply. It's 1208. This is how it looks:
Zhang ( )

On Thu, Aug 1, 2024 at 9:29 AM Javier Sanchez <
javiersanchezbarquero@xxxxxxxxx> wrote:

With option 8 using WRKLNK, check the CCSID that the stream file
was
created with when imported with CPYTOIMPF and tell us back.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related
questions.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related
questions.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related
questions.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.