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 - 3706 days ago
Last viewed on: 16 Apr 2024 (4877 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)

Hi ,

 

I am new into RPG World and learning new things  step by step .I have been working on various  assingment related to IFS . So every time i start working with IFS i got struck with these two things  : CODEPAGE , CCSID . So we need to give our program various hit trail before it's ready for final testing .

It would be grateful if anyone can provide some thought on these two topic . 

 

Thanks

amit  

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: 10 years 1 months 24 days 5 hours 56 minutes ago

Codepage is old, use CCSID

Posted by: Ringer
Premium member *
Comment on: Code page and CCSID
Posted: 10 years 1 months 24 days 3 hours 52 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: 10 years 1 months 23 days 6 hours 7 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.