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



I'm not sure I follow you on the large number of variants.
Forget API's for a moment, can you change job's CCSID etc.?  That would be
one way to force the input data to behave uniformly.

If not, what I had in mind with the iconv api was something along the line
of RTVJOBA (or QUSRJOBI api) to get current jobs CCSID etc., set up the
API's FROM CCSID parm and then force the buffer to the CCSID you want
(hardcoded).
Iconv API is supposed to handle all CCSIDs.

Elvis

-----Original Message-----
 Subject: RE: [C400-L] Local characters encoding problem

Surely worth trying, as it looks that potentially these functions do exactly
what I need to do.
So the only question is where to find "FROM CCSID" and "TO CCSID".
What do you think, is it a correct assumption, that "TO CCSID" is a current
job's CCSID, that I can obtain, if I temporarily add 

system("DSPJOB OPTION(*ALL) OUTPUT(*PRINT)") ;

to my program....

But still even if this is correct, it will leave me with approximately
65,000 variants.....
OK, I can program it, AS/400 is black and made of metal, it is dedicated to
work, but if my assumption is wrong, then it will make 65000*65000
possibilities, which is probably beyond its capabilities :-(


> -----Original Message-----
> From: Elvis Budimlic [mailto:ebudimlic@xxxxxxxxxxxxxxxxxxxxxxxxx]
> Sent: Wednesday, September 21, 2005 12:00 PM
> To: 'C programming iSeries / AS400'
> Subject: RE: [C400-L] Local characters encoding problem
> 
> 
> Perhaps with iconv API you could always force the input to the same
> "regional setting" and thus only maintain one version of code?
> 
> http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/ic
> onvopn.htm
> http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/iconv.htm
> http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/ic
> onvcls.htm
> 
> Not sure, but it may be worth a try.
> 
> Elvis
> 
> -----Original Message-----
>  Subject: [C400-L] Local characters encoding problem
> 
> Having a very unpleasant problem with scrambled local 
> characters in program
> call input parameters.
> Maybe someone can advise me of how to solve it.
> PC program makes a call to a AS/400 program passing some 
> parameters as a
> unsigned char array, that is actually a packed structure. So 
> it contains
> bytes, some of which are actually chars, some are numbers. PC 
> has always one
> and the same local settings.
> Probably my 3 AS/400 have different "regional settings". 
> Result is that
> depending on the particular machine I must use 3 different 
> manually built
> encoding tables.
> We have only 8 local characters, so building this table 
> itself is not a
> problem. But the problem is managing 3 different versions of the same
> program, that work on particular machine.
> For exampl I have letter Ä (capital A with 2 dots above it) 
> that comes to
> one machine as 0x0A and to another machine as 0x24.
> So on one machine I must have a code row :
> 
> for (i = 0; i < 20; i++)
>   if (Buffer[i] == 0x0A) ;
>     Buffer[i] = 'Ä' ;
> 
> and on another machine :
> for (i = 0; i < 20; i++)
>   if (Buffer[i] == 0x24) ;
>     Buffer[i] = 'Ä' ;
> 
> Stupid, isn't it?! Is there a chance to find some proper 
> AS/400 parameter,
> may be some system variable or whatever, that can be tested 
> in order to
> select proper comparison right side?
> 
> Should say here, that I understand, that probably correct way 
> is to take
> care of this encoding is to push it to PC side, but this is 
> not an option
> for certain reasons...
> 
> TIA,
> Jevgeni Astanovski




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.