Midrange News for the IBM i Community


Posted by: AmitAS400
Code page and CCSID
has no ratings.
Published: 23 Feb 2014
Revised: 25 Feb 2014 - 1305 days ago
Last viewed on: 22 Sep 2017 (2691 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Code page and CCSID Published by: AmitAS400 on 23 Feb 2014 view comments(3)

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Code page and CCSID
Posted: 3 years 6 months 28 days 23 hours 38 minutes ago

Codepage is old, use CCSID

Posted by: Ringer
Premium member *
Comment on: Code page and CCSID
Posted: 3 years 6 months 28 days 21 hours 35 minutes ago

By IFS, do you mean the "big PC hard drive" (the ROOT system)? If so, then two popular values are 1252 (Windows) and 819 (Latin-1). Here is a tutorial on using the IFS with RPG http://www.scottklement.com/rpg/ifs_ebook/ifs_ebook.pdf . 

Chris Ringer

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Code page and CCSID
Posted: 3 years 6 months 27 days 23 hours 50 minutes ago

If you're not doing anything terribly fancy, just reading or writing, you can let the system take care of conversion for you. With the Unix-type IFS APIs, the 2nd parameter on open() is oflag, which is really a set of bit flags. If you turn on O_TEXTDATA, then the API will convert to or from the file's CCSID to your program's CCSID (which is normally EBCDIC). You just need to make sure the CCSID of the *STMF matches what is really in the file.