× 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've been having problems with a cmd and some programs that run in different 
countries. The problem deals with character conversions of variant characters. 
Unfortunately, the variant characters cannot be avoided and must be dealt with. 

There are two sources of these variant characters:
1 - input to command by user
2 - written by a program that was compiled in US under CCSID 37

First, these values are written to a physical file and then later copied to a 
stream file using CPYTOSTMF. This process can really make a mess of the variant 
characters under some conditions.

Based on experimenting, I've determined that:
1 - characted input coming from command will be in the code page of the device 
the user is typing on
2 - the data written by the program is always in CCSID 37 (it's a physical file 
so it is always 65535)

Therefore, when the same variant characters are written to the PF from the two 
sources and the device is not using CP 37, there can be two different sets of 
hex values for the same characters.

http://archive.midrange.com/rpg400-l/200301/msg00321.html

Based on the post above by Bruce Vining and reading in Info Center, I need to 
get the program to write its data in the same CCSID as the command by having 
the program figure out what values to use for the variant characters it writes 
rather than writing hard coded values. Once this is accomplished, all the data 
in the PF will be in the same CCSID and then I can explicitly specify the 
CCSIDs to use on the CPYTOSTMF command.

I have all of this working, but I have a couple of questions:

1 - In trying to retrieve the job CCSID via RTVJOBA, I've run across the 
"regular" CCSID versus the "default" CCSID. Although I've read the help text 
and I understand literally what it is saying, I'm confused as to which one to 
use and what it really means in practice. For example, if my system has 
QCCSID=37, my user profile says CCSID=65535 and my terminal device is CP 297, 
the job attributes say CCSID=65535 but DFTCCSID=297 (langid=FRA). DFTCCSID 
ssems to work for me. It is also possible that I am setting up test scenarios 
which are not valid, but it is always nice to handle or at least detect crazy 
configurations with the program rather than a support call.

2 - To retrieve the code page of the terminal, I've been using RTVJOBA to get 
the interactive job name and then use that to call QDCRDEVD API. In my 
experience, this is what I have seen, but is it really safe? Is the interactive 
job name always equal to the device name you are signed in on (assuming command 
is run interactively)?

Thanks,
-Marty


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.