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



QDCXLATE is not recommended....

iconv() is the better option

See here:
http://archive.midrange.com/rpg400-l/200408/msg00502.html
http://www.rpgworld.com/rpg-world/showascii

Charles

On Wed, May 2, 2012 at 2:29 PM, <BButterworth@xxxxxxxxxxxxxx> wrote:
You can also use the QDCXLATE API:

d translate       pr                  extpgm('QDCXLATE')
d  dataLen                       5p 0 const
d  convData                  32766a   options(*varsize)
d  convTable                    10a   const
d  convTblLib                   10a   const options(*nopass)
d  outData                   32766a   options(*nopass: *varsize)
d  outLen                        5p 0 const options(*nopass)
d  convDataLen                   5p 0 options(*nopass)
d  dbcsLang                     10a   const options(*nopass)
d  shiftChars                    1a   const options(*nopass)
d  convType                     10a   const options(*nopass)

...

sendBuffer = request;
sendBufLen = %len(%trim(sendBuffer));

// Translate send buffer to ASCII.
translate(sendBufLen: sendBuffer: 'QTCPASC');

...

Use 'QTCPEBC' to translate to EBCDIC.

(HT Scott Klement)

Blake



date: Wed, 2 May 2012 17:15:52 +0200
from: Henrik R?tzou <hr@xxxxxxxxxxxx>
subject: Re: Is it possible to declare that variable contains ASCII
                data?

No, there are only two possibilities either SBCS (EBCDIC) or DBCS.

This however dosn't mean that a field can't have ASCII in it but you have
to control it yourself and use ICONV to translate back and forth.


On Wed, May 2, 2012 at 4:47 PM, Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:

All,

I was hoping to be able to do something like the following:

    d ascii_txt       s          16383a   ccsid(819)
But I get a
    RNF3819: The CCSID keyword is not valid with the specified data
type.


Also tried
    d ascii_txt       s          16383c   ccsid(819)
But I get a
    RNF3818: CCSID(819) is not valid for field ASCII_TXT.

and
    d ascii_txt       s          16383g   ccsid(819)
But I get a
    RNF0566: Keyword CCSID is not valid for a graphic definition when
CCSID(*GRAPH:*IGNORE) is specified.
I added
    h ccsid(*graph:*src)
But now I'm back to
    RNF3818: CCSID(819) is not valid for field ASCII_TXT.


Given the relationship between 819 and 1208, I also tried using
ccsid(1208) on all the above, if the same results....

Is there no way to tag a variable as containing ASCII data?

Thanks!
--
This is the RPG programming on the IBM i / System i (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.




--
Regards,
Henrik R?tzou

--
This is the RPG programming on the IBM i / System i (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 ...

Follow-Ups:
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.