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



Single environment V5R3... no problems. Thanks for the help guys!

On 9/17/07, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote:

Mike wrote:
Okay... I found an example browsing through the archives and it works.
For
the sake of documentation, this works:

callp unlink ('/web/customerService/webCategories.xml');
fd = open('/web/customerService/webCategories.xml' + x'00':

O_CREAT+O_WRONLY+O_TRUNC+O_TEXTDATA+O_TEXT_CREAT+O_CCSID:
RW*OWNER + RW*GROUP + R: 1208);

You don't need to add x'00' to the path name (unless your prototype is
wrong). That's what options(*string) does, it adds the x'00' for you.


Note that the code you posted requires V5R2. (That's when the
O_TEXT_CREAT flag was added to the IFS APIs). Prior to V5R2, you need
to open the file twice, once to assign the CCSID/Codepage, and a second
time to do translation.

Translation only occurs if the file already exists, thats why you open
it twice, once to create the file, and a second time to do translation.
(And that's what the O_TEXT_CREAT flag solves -- it allows translation
on a file that doesn't exist... or, in IBM's wording, allows TEXT mode
when CREATing a file.)

The O_CCSID keyword requires V5R1. Prior to that, full CCSIDs were not
supported in the IFS, only code pages.

My e-book was written for V4R5. So it uses code pages, and it opens the
file twice. See sections 5.5 and 5.6 where it demonstrates this process.

However, if you don't expect your program to run on a pre-V5R2 system
(which is probably a reasonable assumption today) then use O_TEXT_CREAT
and O_CCSID...
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





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.