×
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 Poul,
I'm looking at the docs for format PWFS0100 in the Information Center at
the following link:
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/rzaii/rzaiimstexfile.htm
I can't find any reference to CCSID 61952 on that page. It claims that
the file name is in CCSID 1200. But, unless you're working with the
Korean language, I don't think the difference between 61952 and 1200
will have much impact on you.
I would define your "File name" field of the PWFS0100 structure as RPG's
data type C (which is UCS2), and set the CCSID to 1200. Then, when you
copy the data type C field to a a data type A (Alphanumeric) field, the
system will automatically convert it to EBCDIC if you are on V5R4 with
the right PTFs. (or V6R1 without any special PTFs). If you are on an
earlier release, you have to use %char() to convert from UCS2 to EBCDIC.
If you are on yet an older release, before RPG added support for
Unicode, you'll have to use iconv()... (which may be the case for you,
since I think you may have to be on V4R5 or older for the IFS to use
CCSID 61952!) which will work great, but requires some extra coding...
If you're on a release that old, let me know and I'll dig up an example.
D Qpwfs_Exit_Parms...
D ds qualified
D User_Profile 10a
D Server_Id 10a
D Function_ID 10u 0
D Format_Name 8a
D RD_Open 1a
D WR_Open 1a
D RD_WR_Open 1a
D Delete_Allow 1a
D Filename_Len 10u 0
D Filename 16383c CCSID(1200)
Then convert it with something like this:
D MyFile s 500a varying
MyFile = %subst( Qpwfs_Exit_Parms.Filename
: 1
: Qpwfs_Exit_Parms.Filename_Len );
or on pre V5R4:
MyFile = %char(%subst( Qpwfs_Exit_Parms.Filename
: 1
: Qpwfs_Exit_Parms.Filename_Len ));
Or.. like I said, if you need to go back even further and use iconv(),
let me know and I'll dig up an example.
Aschenbrenner, Poul wrote:
Can som one tell haw to convert string from ASCII CCSID 61952 to EBCDIC
037.
I have try %Char and define varibales as CCSID with no luck.
And I have also try iconv() but I can not find any describtion for this.
I am using QIBM_QPWFS_FILE_SERV Format PWFS0100 and this return
File name in the following format.
The name of the file. The length of this field is specified by the
File Name Length (the previous field). The file name is returned in
the ISO/IEC 10646 (UCS--2 Level 1) character set, CCSID 61952.
I can see that CCSID 61952 must be in dual byte and I want to
convert it to text variable.
Best Regards
Poul
As an Amazon Associate we earn from qualifying purchases.