PL/1 hex format

IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

PL/1 hex format

Postby Puja » Sun Jan 18, 2015 11:38 pm

I am new to PL/1 and I need to know how to convert a character into hexadecimal format and how do I use it in the 'if' condition. Can any1 explain me with suitable example.

Posts: 1
Joined: Sun Jan 18, 2015 11:28 pm
Has thanked: 0 time
Been thanked: 0 time

Re: PL/1 hex format

Postby prino » Mon Jan 19, 2015 3:04 am


Please use professional language, and explain your requirement more clearly.

Why would you want to convert character data to hexadecimal and use it in a compare, when you can compare character data directly to hexadecimal ('nn'bx) data?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: PL/1 hex format

Postby Akatsukami » Tue Jan 20, 2015 6:41 pm

Character data are hexadecimal data; as Mr. Prins indicates, comparisons between character and hexadecimal literals are trivial.

If you mean that you wish to convert, e.g., 'A' into 'C1', I suggest looking at the HEX and HEXIMAGE functions.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Global moderator
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Return to PL/I