The table for TROT isn't that bad, although I prefer the UNPK/TR technique as 
it hits the cache less. The table for TRTO is truly massive in terms of cache 
hits. In both cases I would generate the table in a macro rather than by hand.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Lennie Dymoke-Bradshaw [[email protected]]
Sent: Wednesday, June 14, 2023 3:11 AM
To: [email protected]
Subject: Re: Char to Hex

In assembler there are 2 instructions for handling Char to Hex and Hex to Char.

TRTO - Translate Two to One
TROT - Translate One to Two

It is the TROT instruction I usually use for producing printable HEX, but I 
think you need the TRTO instruction.
Once you have set up the tables it is the simplest I can find. Certainly far 
easier that the UNPK method of old.

Lennie Dymoke-Bradshaw
https://secure-web.cisco.com/1m_28YrQHIU_oSdEfGkUjQkLi9CKZxsMQXVg4McNdqNrOw5qQ-rCowup3YwsQnm8e4-u_XWI6KzWY7q1bPMpuGP-bsSbSzRVyUu63lw_jg7zyulm3fFb9iBudFn_nbSUnuCtzxphe40qTF9QOL9sCT5bnnrSGZ3tLF3cEd0NJ9AiiKzRC7XCIzV-ww22kho4s43_hEUSuZtPJAIpu4OiADveb0AvhcR_Pp0U3SQKdi9NtH_FZjg-3F6RrwtK0B7jml28Uo0QCvihMUCPM-ZeBex1Yv9X7HNZvdFPcmNdO7jgvHsLFqtnm0GuS8rgu9vevqi5Kb5GaZeXJmG9UcL0tKHn2TFLTWRN7K92mcwfSo7u4l6kZHsGR5bkRo-DziC4wdzqK4WGg8ugns3Y3r7IS4afQ7hbf2z0m_-DEbfXAOIk/https%3A%2F%2Frsclweb.com
‘Dance like no one is watching. Encrypt like everyone is.’

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Ituriel do Neto
Sent: Tuesday, June 13, 2023 8:06 PM
To: [email protected]
Subject: Char to Hex

Hi all,

I don't want to reinvent the wheel, so I would be grateful for your advice.
I need to convert C'123AB' to X'0123AB'

Any ideas?


Best Regards

Ituriel do Nascimento Neto
z/OS System Programmer

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to