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



Hi Doug,
That's my 5 cents from my personal experience reading and writing IFS files
from RPG programs.
The command/program/application that writes an ASCII file is in charge of
setting the right encoding for the data inside it. So, how data are written
depends on what CCSID is set in PASE environment when the touch command
creates the file.
This attribute is not set into the file itself, meaning you can't derive it
just by looking at the data contained in it.
Code page 819 is a generic CCSID used for a file in the IFS created without
setting the CCSID attribute when the file is first opened for writing; so,
in this case, you have to change the file CCSID attribute before trying to
read it.
Assuming the file is UTF-8 encoded from PASE, then you must issue a CHGATR
command to set the CCSID attribute to 1208 (equivalent to UTF-8). Or 1200
equivalent to UTF-16.
AFAIK, if no encoding is set before running the touch command to write the
file, PASE will assume the file is encoded with the same CCSID as the
system itself; if this is the case use the CHGATR command to set the CCSID
attribute of your file to the very same CCSID of your system.
This is the link to V7R3 documentation for PASE:
https://www.ibm.com/docs/en/i/7.3?topic=programming-pase-i

Hope it helps.

Lucia


Il giorno mer 30 nov 2022 alle ore 23:52 DEnglander--- via RPG400-L <
rpg400-l@xxxxxxxxxxxxxxxxxx> ha scritto:

I have an RPG program that needs to read an IFS file. The IFS file is
created using the PASE touch command, and no CCSID number is specified.
When I go into WRKLNK to the file and use option #8, it shows CCSID of
819. However, when I enter option #2 on the file then take F15, it shows a
CCSID of 500. When I display the file in WRKLNK using option 5, the data
looks fine and I can read it.

When I look at the file in ACS, it shows as "garbage" whether or not I
view as a UTF-8 file.

When I run a SQL statement using qsys2.ifs_read, I also see garbage.

When I attempt to read it in with RPG, I still see garbage. In the RPG
program, I use the _C_IFS_FGETS procedure to read the IFS file. The field
that is defined to receive the data is defined with CCSID(819). It still
shows as garbage.

What do I need to do to have RPG be able to "see" the data in this IFS
file in the same format as WRKLNK option #5?

I have a feeling this has something to do with the file being created by
TOUCH, but am not sure.

Any ideas?

Thank you,

Doug



"CONFIDENTIALITY NOTICE: This e-mail transmission (and/or the attachments
accompanying it) contain confidential information belonging to the sender.
The information is intended only for the use of the intended recipient. If
you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution or the taking of any action in reliance
on the contents of the information is strictly prohibited. Any
unauthorized interception of this transmission is illegal under the law.
If you have received this transmission in error, please promptly notify the
sender by reply e-mail, and then destroy all copies of the transmission."
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.