Jim
Try this:
01 char10 pic x(10) value "ABC123xyz!".
01 binval-x.
05 binval pic s9(9) comp.
01 hexval pic x(20).
move char10(1:4) to binval-x.
call intrinsic "dascii" using \binval\ \16\ hexval(1:).
move char10(5:4) to binval-x.
call intrinsic "dascii" using \binval\ \16\ hexval(9:).
move char10(7:4) to binval-x.
call intrinsic "dascii" using \binval\ \16\ hexval(13:).
display hexval.
Note that dascii works on 4 bytes at a time so I overlapped the
the second and third call (1st call does bytes 1-4, 2nd does
5-8, and 3rd does 7-10).
Alan
Jim Chance wrote:
>
> Does anyone know how to display a character X(10) field
> within a COBOL program using the display command to force
> the resulting value in HEX?
>
> =====
> Practical Technology Solutions
> Jim Chance, CEO/President
> 1031 Thomas Drive
> Ashland, Ohio 44805
> Voice: 419-651-6704
> E-Mail: [log in to unmask]
> "An independent/self-employed provider of premium and practical HPe3000 business system solutions. Services specializing in COBOL, Sqlplus, Oracle, Qedit, Suprtool, Powerhouse, Management, Operations, Database, & Analysis consultations." IT purveyor since 1985.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|