I need to send an ascii 'ESC' (hex 1B) to an application, I'm using QDCXLATE to translate between ebcidic and ascii, the Ebcidic equivalent of 'ESC' is CU1, how do I code a character representation of 'CU1' so it can be converted?
Thanks in advance.
scott_klement 2700007QFX245 Posts
Re: CU1 Character2013-02-17T20:48:44ZThis is the accepted answer. This is the accepted answer.
- JohnxLong 270001H26F
x'27' is the Escape character (not CU1) in EBCDIC. I think you already came to that conclusion...
FWIW, if you're using QDCZLATE (which I do not recommend) then which character translates to which will depend on which translation table you're using. And if you want to look up what the translations are, it's really quite easy to look at the table and see what the translations are.
For example, if you wanted to see the QTCPASC table, you could:
WRKTBL TBL(QTCPASC) -- now take opt 5=Display
In this example, you can see that x'27' translates to ASCII X'1B'.
However, it's important to remember that there are many different flavors of EBCDIC... they're not all the same. Likewise, there are many different flavors of ASCII. You should endeavor to know precisely which flavor of EBCDIC/ASCII you want to work with. If you know the CCSID number of each, then translation becomes very easy, just plug in the right CCSIDs, and it's pretty much done for you.