HP3000-L Archives

April 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Alan Denmark <[log in to unmask]>
Reply To:
Alan Denmark <[log in to unmask]>
Date:
Fri, 27 Apr 2001 22:46:07 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (49 lines)
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 *

ATOM RSS1 RSS2