|
John.R.Finney wrote: >Still, does anyone know of a way >(for future reference) whereby I could firstly >lookup the character in question and >determine the ASCII / HEX value of this ? I loved Raul's suggestion of a character map in ReXX, but I'll post an RPG solution for the list to work on: h debug dftactgrp(*no) actgrp('QILE') bnddir('QC2LE') * dbgview(*list) d H2C pr Extproc('cvthc') d RecP * value d SrcP * value d SizeP 10I 0 value d* Translate EBCDIC/ASCII d transChr pr Extpgm('QDCXLATE') d XLStrLen 5p 0 d XLStr like(chrA) d XLTable 10a d ChrEP s * inz d ChrXP s * inz d chrX s 2 d chrA s 1 d Size s 10i 0 d E2ATable s 10 Inz('QASCII') d outMsg s 24 d XLStrLen s 5p 0 d ds d chrE 2 2 d i 1 2u 0 c eval ChrXP=%Addr(chrX) c eval ChrEP=%Addr(chrE) c eval Size=%len(chrX) c 64 do 255 i c callp H2C(ChrXP : c ChrEP : c Size) c eval chrA = chrE c eval XLStrLen = %len(chrA) c callp transChr(XLStrLen: ChrA: E2ATable) c eval outMsg = %trim(%editc(i: 'Z')) + '-' + c chrX + '-' + c chrE + '-' + c chrA c outMsg dsply 'BUCK' c enddo c eval *InLR = *On This uses the QASCII translate table. Specific code page translation requires iconv(), I think. Buck Calabro Aptis; Albany, NY "We are what we repeatedly do. Excellence, then, is not an act, but a habit." --Aristotle Billing Concepts Corp., a NASDAQ Listed Company, Symbol: BILL +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.